Open Bug 1042035 Opened 5 years ago Updated 5 years ago

Refactor test_ipc tests to avoid code duplication

Categories

(Testing :: Mochitest, defect)

defect
Not set

Tracking

(Not tracked)

REOPENED

People

(Reporter: akachkach, Assigned: akachkach)

Details

Attachments

(1 file, 2 obsolete files)

The test_ipc tests (namely: "content/media/webspeech/synth/ipc/test/test_ipc.html", "dom/devicestorage/ipc/test_ipc.html", "dom/indexedDB/ipc/test_ipc.html" and "dom/media/tests/ipc/test_ipc.html") have a lot of duplicated code, and it's currently painful to modify it (like in bug 886570).

A large portion of that code should be factored-out in a separate file included by those tests.
Bug 1010285 talks about disabling these tests all together, if I understand correctly.
Yes, I just saw it and I wonder what its state is. If mochitest-e10s's coverage is equivalent to the test_ipc coverage, it's probably better to just deactivate them.
Assignee: akachkach → nobody
Probably better to wait for bug 1010285 (replacing test_ipc by the e10s tests)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Actually, we'll probably have to fix this since we could still have to work on the IPC tests before they're disabled (like for bug 1057558)
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
WIP patch;

I'm having some trouble sharing some IPC code because of this:

http://dxr.mozilla.org/mozilla-central/source/dom/indexedDB/ipc/test_ipc.html#109

If I change the iframeSecondFunction by a function "dynamically" generated (with a closure to give the correct IPC "namespace") it doesn't work, because only the function's code is passed to the second iframe.

Is there a simple/clean way to do this? I'm not really familiar with IPC tests or iframes for that matter :)
Flags: needinfo?(Ms2ger)
Found a way (by passing the parameter in loadFrameScript too)
Assignee: nobody → akachkach
Flags: needinfo?(Ms2ger)
Attached patch 0001-Merge-ipc-tests.patch (obsolete) — Splinter Review
WIP patch.

Works OK, but I have a bug on a particular test in indexedDB: is(usingChildProcess, true, "Expecting to run in child process");

(The callback doesn't seem to be called even if it's set-up properly)
Attachment #8479520 - Attachment is obsolete: true
Old patch, here's the updated one.
Attachment #8480623 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.