Wednesday, July 18, 2018 | Anny G's blog

Wednesday, July 18, 2018

Written on Jul 18, 2018

lldb show more of frame

set set stop-line-count-after 10 set set stop-line-count-before 10

Responding to

On realizing the tests have a bug in them

In order to avoid calling DataTransfer::GetData, I made some modifications to Clipboard.cpp, DataTransfer.cpp, DataTransferItem.cpp in order to retrieve the data transfer item as a string. When I was doing a live demo using the following

I noticed that pasting text no longer worked. I was baffled because when I was running clipboard tests, it worked. I thought it was perhaps I have two different code paths for chrome and content processes. TODO what did I do. I decided to debug individual tests so I uncommented all tests but one of them - test_contentscript_clipboard_permission_readtext.js. Then, I saw that it was failing. I thought it was failing because I am debugging the test, so I quit my debugging and run the test on its own. To my surprise there was an error saying that no asserts were run, and I should use SimpleTest.waitForExplicitFinish if I need it. Then, I investigated the individual test and realized that at one point I assume that the promise gets resolved by the time I signal that the test is done. I then thought I could use await inside of the content script, but that didn’t work so then instead, in both branches of the promise, in case of success and in case of error, I would signal that I was done. This worked out and the test failed as expected.


What I learned about web-standards