Closed Bug 1034512 Opened 10 years ago Closed 9 years ago

Enable 'shared' tests with e10s

Categories

(DevTools :: Framework, defect)

defect
Not set
normal

Tracking

(e10s+)

RESOLVED FIXED
Firefox 38
Tracking Status
e10s + ---

People

(Reporter: jwalker, Assigned: pbro)

References

(Blocks 1 open bug)

Details

(Whiteboard: [e10s-m6])

Attachments

(13 files, 26 obsolete files)

8.03 KB, patch
pbro
: review+
Details | Diff | Splinter Review
44.26 KB, patch
pbro
: review+
Details | Diff | Splinter Review
4.16 KB, patch
pbro
: review+
Details | Diff | Splinter Review
5.42 KB, patch
pbro
: review+
Details | Diff | Splinter Review
5.79 KB, patch
pbro
: review+
Details | Diff | Splinter Review
87.12 KB, patch
pbro
: review+
Details | Diff | Splinter Review
3.22 KB, patch
pbro
: review+
Details | Diff | Splinter Review
17.81 KB, patch
pbro
: review+
Details | Diff | Splinter Review
6.30 KB, patch
pbro
: review+
Details | Diff | Splinter Review
37.72 KB, patch
pbro
: review+
Details | Diff | Splinter Review
1.46 KB, patch
pbro
: review+
Details | Diff | Splinter Review
4.90 KB, patch
pbro
: review+
Details | Diff | Splinter Review
2.00 KB, patch
pbro
: review+
Details | Diff | Splinter Review
+++ This bug was initially created as a clone of Bug #1034511 +++
Moving DevTools test bugs to e10s milestone M7 (i.e. not blocking e10s merge to Aurora).
Whiteboard: [e10s-m7]
Whiteboard: [e10s-m7] → [e10s-m6]
Joe, stealing this bug from you. I don't think you intended it to be assigned to you in the first place since I don't see the assigned flag having changed, that probably came from cloning the bug.

There's a bunch of cubic-bezier tests in the /shared/ folder that I know how to fix for e10s, starting with these now.
Assignee: jwalker → pbrosset
Attached patch bug1034512-3-use-add_task.patch (obsolete) — Splinter Review
Attached patch bug1034512-6-fix-spectrum.patch (obsolete) — Splinter Review
So these first 6 patches make more than 50% of the tests in this folder pass with e10s.
One of them also refactors most of the async tests to use add_task.

Next up are the telemetry tests. I'll start working on them tomorrow.
A lot of these tests were loading common devtools widgets into a content page, and testing them from there.
With e10s, this breaks in various ways.
I've changed several of the tests to run instead in a toolbox host, which is something that runs in the chrome of the browser, so in the parent process. This is better because that's where they are used anyway.
Makes the Telemetry-related tests in browser/shared/devtools/test/ run with e10s.

Worth noting:

- I had to disable a couple of them (browser_telemetry_button_paintflashing and browser_telemetry_button_responsive) because the corresponding tool don't work with e10s.
- I removed a large amount of duplicated code from these tests.
- I rewrote them to use add_task.
The templater test already works fine with e10s, but it makes a lot of accesses to the content DOM through CPOWs. So this patch appends the rendered template into a toolbox host instead of in the content tab.
I also removed the need for the deprecated sync thenable.
rebased part 3.
Attachment #8547637 - Attachment is obsolete: true
Fixed the treeWidget tests for e10s.
part 10 - The last remaining test was browser_toolbar_webconsole_errors_count.js.

This was a hard one, primarily because it's a very long test, and because it didn't even pass for me locally without e10s!! This is odd, because this test isn't disabled, so it must be passing for other people.

To make it pass again, I had to dive deep in its code, and pretty rewrite the whole thing, making extensive use a tasks/promises, flattening the code, adding info statement all over. I also added a couple of frame-script messageManager magic, because the test was accessing the content page for various stuff.

I got it passing locally without e10s, but it looks like the error counter in the gcli developertoolbar doesn't work well with e10s, so I'm going to have to disable the test for e10s anyway.
Disabling the test with e10s
Attachment #8551369 - Attachment is obsolete: true
part 11 - Cleaned up and fixed a test that was introduced while I was working on this bug: browser_options-view-01.js
Comment on attachment 8547636 [details] [diff] [review]
bug1034512-2-fix-cubicbezierwidget-tests.patch

Hey Brian, this makes the cubicbezierwidget tests pass with e10s by making them run in a toolbox host window instead of inside the content window.
Also made the tests use add_task.
Attachment #8547636 - Flags: review?(bgrinstead)
Comment on attachment 8551278 [details] [diff] [review]
bug1034512-3-use-add_task v2.patch

More add_task all around.
Attachment #8551278 - Flags: review?(bgrinstead)
Comment on attachment 8547638 [details] [diff] [review]
bug1034512-4-fix-inplace-editor.patch

Joe, this makes the inplace-editor test pass with E10S by making it run inside a toolbox host window rather than inside a content window.
All devtools widgets ultimately run inside toolbox hosts anyway, and I think it makes more sense to be running those tests there rather than re-writing them all through framescripts.
Attachment #8547638 - Flags: review?(jwalker)
Comment on attachment 8547639 [details] [diff] [review]
bug1034512-5-fix-output-parser.patch

Sorry Mike for stacking yet another review on your list :( but you're the one who knows the output parser the best.

Changes in this patch:
- disabled a couple of layouthelpers tests with e10s for now, will file a bug to migrate them over
- re-wrote a little bit the outputparser test:
  - used the async test add_task test runner
  - made the test run in a toolbox host window instead of a content window
  - move all test step function calls into the main performTest function instead of having each step call the next one (I think this is more readable this way).
Attachment #8547639 - Flags: review?(mratcliffe)
Comment on attachment 8547640 [details] [diff] [review]
bug1034512-6-fix-spectrum.patch

This patch makes the spectrum (color picker) tests pass with e10s.
- used add_task
- moved all test step functions in the main performTest function for easier readability
- made the test run in a toolbox host window
- also removed the synthesized event to change the color to make it simpler by calling the callback directly. I've not grown very fond of synthesizing events in tests, I found they often end up being problematic, and I don't think it's a big deal calling event handlers directly in tests because testing the event -> handler part isn't very useful.
Attachment #8547640 - Flags: review?(bgrinstead)
Comment on attachment 8550296 [details] [diff] [review]
bug1034512-7-fix-telemetry-tests.patch

I would have flagged Mike for review for this one but his review queue is overflowing right now.
Here's a description of the changes here:

- I disabled a couple of telemetry tests for paintflashing and responsiveview because these tools don't work with e10s yet.
- I rewrote a large part of the tests:
  - cleaned up useless imports
  - made use of add_task and promiseTab to simplify a lot the setup/tearDown phases of each test
  - moved an important amount of code to head.js as it was duplicated in pretty much all of the telemetry tests
 
This might look like a lot of changes, but once you've looked at one test, you'll see the other more or less follow the exact same pattern.
Attachment #8550296 - Flags: review?(jwalker)
Comment on attachment 8551698 [details] [diff] [review]
bug1034512-11-cleanup-browser_options-view-01.js.patch

Jordan, after a lot of changes made to the devtools/shared/test directory, I had to modify the browser_options-view-01.js test too to:

- make it run in a toolbox host window instead of content window, to make sure it works well with e10s, without having to go through CPOWs,
- wrap it in add_task for consistency and better error handling,
- remove a couple of unused functions.
Attachment #8551698 - Flags: review?(jsantell)
Comment on attachment 8547635 [details] [diff] [review]
bug1034512-1-enable-shared-test-e10s.patch

r=me for this test-enabling-only patch (just removed the skip-if).
However, I need to make sure this patch goes in last.
Attachment #8547635 - Flags: review+
Attachment #8547638 - Flags: review?(jwalker) → review+
Attachment #8550296 - Flags: review?(jwalker) → review+
Comment on attachment 8551698 [details] [diff] [review]
bug1034512-11-cleanup-browser_options-view-01.js.patch

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

Looks good!

::: browser/devtools/shared/test/browser_options-view-01.js
@@ +81,3 @@
>    return new OptionsView({
>      branchName: BRANCH,
> +    window: win,

nit: In a recent patch, `window` option was removed from the OptionsView constructor as we can get this from the `menupopup`
Attachment #8551698 - Flags: review?(jsantell) → review+
Thanks Jordan. I removed the extra window property.
Attachment #8551698 - Attachment is obsolete: true
Attachment #8551979 - Flags: review+
Comment on attachment 8547636 [details] [diff] [review]
bug1034512-2-fix-cubicbezierwidget-tests.patch

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

::: browser/devtools/shared/test/browser_cubic-bezier-01.js
@@ +7,5 @@
>  // Tests that the CubicBezierWidget generates content in a given parent node
>  
>  const TEST_URI = "chrome://browser/content/devtools/cubic-bezier-frame.xhtml";
>  const {CubicBezierWidget} = devtools.require("devtools/shared/widgets/CubicBezierWidget");
> +const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});

Do you need {DOMHelpers} and {Hosts} in any of these 3 files?  I don't see any other references to them
Attachment #8547636 - Flags: review?(bgrinstead) → review+
Status: NEW → ASSIGNED
Comment on attachment 8547640 [details] [diff] [review]
bug1034512-6-fix-spectrum.patch

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

::: browser/devtools/shared/test/browser_spectrum.js
@@ +5,5 @@
>  // Tests that the spectrum color picker works correctly
>  
>  const TEST_URI = "chrome://browser/content/devtools/spectrum-frame.xhtml";
>  const {Spectrum} = devtools.require("devtools/shared/widgets/Spectrum");
> +const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});

Here are DomHelpers and Hosts again - should these just be moved into head.js?

@@ +91,3 @@
>  
> +    // Simulate a drag move event by calling the handler directly.
> +    s.onDraggerMove(s.dragger.offsetWidth/2, s.dragger.offsetHeight/2);

Now that this is in a host, we could stick with the eventutils calls in theory, right?  Keeping that could help possibly add test coverage to the case where onDraggerMove is inappropriately bound to the element.  I'm fairly sure that executesoon is unnecessary, so it would (in theory) be just a matter of switching this line out with:

EventUtils.synthesizeMouse(s.dragger, s.dragger.offsetWidth/2, s.dragger.offsetHeight/2, {}, doc.defaultView);

Not a huge deal, just curious why you switched to calling the handler directly.
Attachment #8547640 - Flags: review?(bgrinstead) → review+
Comment on attachment 8551278 [details] [diff] [review]
bug1034512-3-use-add_task v2.patch

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

Nice
Attachment #8551278 - Flags: review?(bgrinstead) → review+
(In reply to Brian Grinstead [:bgrins] from comment #29)
> Comment on attachment 8547636 [details] [diff] [review]
> bug1034512-2-fix-cubicbezierwidget-tests.patch
> 
> Review of attachment 8547636 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: browser/devtools/shared/test/browser_cubic-bezier-01.js
> @@ +7,5 @@
> >  // Tests that the CubicBezierWidget generates content in a given parent node
> >  
> >  const TEST_URI = "chrome://browser/content/devtools/cubic-bezier-frame.xhtml";
> >  const {CubicBezierWidget} = devtools.require("devtools/shared/widgets/CubicBezierWidget");
> > +const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});
> 
> Do you need {DOMHelpers} and {Hosts} in any of these 3 files?  I don't see
> any other references to them
In fact |createHost| needs them to be imported. These imports should really be in head.js in fact. I will move them there.
Moved the 2 imports needed for createHost into head.js.
Attachment #8547636 - Attachment is obsolete: true
Attachment #8552356 - Flags: review+
Removed the 2 createHost imports now that they are in head.js.
Attachment #8547638 - Attachment is obsolete: true
Attachment #8552357 - Flags: review+
Removed 2 useless imports.
Attachment #8547639 - Attachment is obsolete: true
Attachment #8547639 - Flags: review?(mratcliffe)
Attachment #8552358 - Flags: review?(mratcliffe)
(In reply to Brian Grinstead [:bgrins] from comment #30)
> Comment on attachment 8547640 [details] [diff] [review]
> bug1034512-6-fix-spectrum.patch
> 
> Review of attachment 8547640 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: browser/devtools/shared/test/browser_spectrum.js
> @@ +5,5 @@
> >  // Tests that the spectrum color picker works correctly
> >  
> >  const TEST_URI = "chrome://browser/content/devtools/spectrum-frame.xhtml";
> >  const {Spectrum} = devtools.require("devtools/shared/widgets/Spectrum");
> > +const {DOMHelpers} = Cu.import("resource:///modules/devtools/DOMHelpers.jsm", {});
> 
> Here are DomHelpers and Hosts again - should these just be moved into
> head.js?
Done.

> @@ +91,3 @@
> >  
> > +    // Simulate a drag move event by calling the handler directly.
> > +    s.onDraggerMove(s.dragger.offsetWidth/2, s.dragger.offsetHeight/2);
> 
> Now that this is in a host, we could stick with the eventutils calls in
> theory, right?  Keeping that could help possibly add test coverage to the
> case where onDraggerMove is inappropriately bound to the element.  I'm
> fairly sure that executesoon is unnecessary, so it would (in theory) be just
> a matter of switching this line out with:
> 
> EventUtils.synthesizeMouse(s.dragger, s.dragger.offsetWidth/2,
> s.dragger.offsetHeight/2, {}, doc.defaultView);
> 
> Not a huge deal, just curious why you switched to calling the handler
> directly.
I can't explain it, but the synthesized event doesn't work at all after moving this test to the host. The event just doesn't get handled by the widget. That's why I ended up calling the onDraggerMove callback directly.
Attachment #8547640 - Attachment is obsolete: true
Attachment #8552367 - Flags: review+
Rebased.
Attachment #8550296 - Attachment is obsolete: true
Attachment #8552370 - Flags: review+
Removed 2 useless imports now that they are in head.js.
See comment 12 for more info about changes in this patch.
Attachment #8550310 - Attachment is obsolete: true
Attachment #8552371 - Flags: review?(jwalker)
Removed 2 useless imports.
Attachment #8551288 - Attachment is obsolete: true
Attachment #8552372 - Flags: review?(bgrinstead)
Comment on attachment 8552371 [details] [diff] [review]
bug1034512-8-templater-test-cpow v2.patch

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

::: browser/devtools/shared/test/browser_templater_basic.js
@@ +282,5 @@
>  
>  function delayReply(data) {
> +  return new Promise(resolve => {
> +    executeSoon(() => {
> +      resolve(data);

I don't think we need this now, since promises are async by nature, but maybe it's now worth taking out.
Attachment #8552371 - Flags: review?(jwalker) → review+
Removed 2 useless imports.
Attachment #8551979 - Attachment is obsolete: true
Attachment #8552374 - Flags: review+
Hey Victor, several new tests in this directory needed to call createHost, and so I've moved the 2 related imports (Hosts and DOMHelpers) to head.js. 
This patch is simply about removing the duplicated imports from the test files they remained in.
Attachment #8552387 - Flags: review?(vporof)
Thanks Joe. And yes, you're right, we can get rid of the executeSoon function call. I've removed it here.
Attachment #8552371 - Attachment is obsolete: true
Attachment #8552390 - Flags: review+
Not directly related to e10s, but the theme test had some unneeded imports and calls to waitForExplicitFinish. So I cleaned it up a bit.
Attachment #8552423 - Flags: review?(jwalker)
Part 14 fixes browser_css_color.js with e10s.
It was passing with e10s but was intermittently timing out. That's because it was accessing the content document to manipulate a canvas element a lot of times (iterating over colors), and with e10s, each and every access to the content page had to be handled through CPOWs, making the test take a big amount of time.
It now runs in a toolbox host window instead.
I've also made it use add_task.
Attachment #8552424 - Flags: review?(mratcliffe)
Attachment #8552423 - Flags: review?(jwalker) → review+
In my last try build (https://treeherder.mozilla.org/#/jobs?repo=try&revision=af551cda3239), browser_css_color.js was still failing intermittently with e10s, but I believe I have fixed it with attachment 8552424 [details] [diff] [review].
The other failing test is browser_outputparser.js and it also fails intermittently with e10s, but I'm not sure why.
Since this bug already has 14 parts, I'm thinking I will disable it for e10s for now and file a separate bug to fix this test instead.
(In reply to Patrick Brosset [:pbrosset] [:patrick] from comment #46)
> In my last try build
> (https://treeherder.mozilla.org/#/jobs?repo=try&revision=af551cda3239),
> browser_css_color.js was still failing intermittently with e10s, but I
> believe I have fixed it with attachment 8552424 [details] [diff] [review].
> The other failing test is browser_outputparser.js and it also fails
> intermittently with e10s, but I'm not sure why.
> Since this bug already has 14 parts, I'm thinking I will disable it for e10s
> for now and file a separate bug to fix this test instead.
Filed bug 1124162
Comment on attachment 8552387 [details] [diff] [review]
bug1034512-12-removed-toolboxhost-imports.patch

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

r+ if tests still pass
Attachment #8552387 - Flags: review?(vporof) → review+
Attachment #8552372 - Flags: review?(bgrinstead) → review+
Attachment #8552358 - Flags: review?(mratcliffe) → review+
Attachment #8552424 - Flags: review?(mratcliffe) → review+
I have filed bug 1125768 for test browser_toolbar_webconsole_errors_count.js instead of asking for a review for it here.
I have disabled the test for e10s for now anyway since the feature it is testing doesn't seem to work with e10s anyway.

Now that all other patches have been R+'d, I'll just do a little renaming, re-ordering of patches, and attach them all here again (carrying R+s over).

In the meantime, here's a final TRY push for all patches: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f8945b244372
Attachment #8547635 - Attachment is obsolete: true
Attachment #8551278 - Attachment is obsolete: true
Attachment #8551370 - Attachment is obsolete: true
Attachment #8552356 - Attachment is obsolete: true
Attachment #8552357 - Attachment is obsolete: true
Attachment #8552358 - Attachment is obsolete: true
Attachment #8552367 - Attachment is obsolete: true
Attachment #8552370 - Attachment is obsolete: true
Attachment #8552372 - Attachment is obsolete: true
Attachment #8552374 - Attachment is obsolete: true
Attachment #8552387 - Attachment is obsolete: true
Attachment #8552390 - Attachment is obsolete: true
Attachment #8552423 - Attachment is obsolete: true
Attachment #8552424 - Attachment is obsolete: true
Attachment #8554456 - Flags: review+
Attachment #8554459 - Flags: review+
Keywords: checkin-needed
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: