Closed Bug 1169287 Opened 5 years ago Closed 3 years ago

Intermittent browser_visibleFindSelection.js | scroll should include find result

Categories

(Toolkit :: Find Toolbar, defect, P5)

x86
Windows 7
defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
e10s + ---
firefox50 --- fixed
firefox51 --- fixed
firefox52 --- fixed

People

(Reporter: RyanVM, Assigned: smaug)

References

(Blocks 1 open bug)

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 1 obsolete file)

06:04:26 INFO - 571 INFO TEST-START | browser/base/content/test/general/browser_visibleFindSelection.js
06:04:26 INFO - 572 INFO checking window state
06:04:26 INFO - 573 INFO Entering test
06:04:26 INFO - 574 INFO Wait tab event: load
06:04:26 INFO - 575 INFO Tab event received: load
06:04:26 INFO - 576 INFO Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,%3Cdiv%20style%3D%27position%3A%20absolute%3B%20left%3A%202200px%3B%20background%3A%20green%3B%20width%3A%20200px%3B%20height%3A%20200px%3B%27%3Ediv%3C/div%3E%3Cdiv%20%20style%3D%27position%3A%20absolute%3B%20left%3A%200px%3B%20background%3A%20red%3B%20width%3A%20200px%3B%20height%3A%20200px%3B%27%3E%3Cspan%20id%3D%27s%27%3Ediv%3C/span%3E%3C/div%3E" line: 0}]
06:04:26 INFO - 577 INFO Waiting for findbaropen
06:04:26 INFO - 578 INFO Saw findbaropen
06:04:26 INFO - 579 INFO TEST-PASS | browser/base/content/test/general/browser_visibleFindSelection.js | find bar is now initialized
06:04:26 INFO - 580 INFO Waiting for scroll
06:04:26 INFO - 581 INFO Saw scroll
06:04:26 INFO - 582 INFO Waiting for scroll
06:04:26 INFO - 583 INFO Saw scroll
06:04:26 INFO - 584 INFO TEST-UNEXPECTED-FAIL | browser/base/content/test/general/browser_visibleFindSelection.js | scroll should include find result -
06:04:26 INFO - Stack trace:
06:04:26 INFO - chrome://mochitests/content/browser/browser/base/content/test/general/browser_visibleFindSelection.js:null:33
06:04:26 INFO - self-hosted:InterpretGeneratorResume:716
06:04:26 INFO - self-hosted:next:624
06:04:26 INFO - Tester_execTest@chrome://mochikit/content/browser-test.js:741:9
06:04:26 INFO - Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:664:7
06:04:26 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:745:59
06:04:26 INFO - 585 INFO Leaving test
06:04:26 INFO - MEMORY STAT vsize after test: 1058320384
06:04:26 INFO - MEMORY STAT vsizeMaxContiguous after test: 134934528
06:04:26 INFO - MEMORY STAT residentFast after test: 391098368
06:04:26 INFO - MEMORY STAT heapAllocated after test: 107875192
06:04:26 INFO - 586 INFO TEST-OK | browser/base/content/test/general/browser_visibleFindSelection.js | took 259ms
Might be related to the disabling of browser_popup_blocker.js. When debugging that test, this one often failed.
I only disabled browser_popup_blocker.js on Linux and this failure was on Win7.
Priority: -- → P5
This or some form of this becomes perma-failure once bug 1306591 lands.
Blocks: 1306591
Attached patch wip (obsolete) — Splinter Review
Ensure that the latter scroll event is actually for the scroll we're waiting for, not some previous scroll.
Assignee: nobody → bugs
Attachment #8799874 - Flags: review?(mdeboer)
Comment on attachment 8799874 [details] [diff] [review]
wip

Review of attachment 8799874 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with a green try-run... But I'm already happy if it fixes the intermittent. Thanks!

::: browser/base/content/test/general/browser_visibleFindSelection.js
@@ +22,5 @@
>    yield scrollPromise;
>  
> +  // Wait for one paint to ensure we've processed the previous key events and scrolling.
> +  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
> +    return new Promise(function(resolve) {

nit:

```js
return new Promise(
  resolve => content.requestAnimationFrame(() => setTimeout(resolve, 0))
);
```

However, I'd agree with adding a few braces here and there for readability's sake :)
Attachment #8799874 - Flags: review?(mdeboer) → review+
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6dd44f67ecd7
try to make browser_visibleFindSelection.js more reliable, r=mikedeboer
https://hg.mozilla.org/mozilla-central/rev/6dd44f67ecd7
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.