Closed Bug 664152 Opened 11 years ago Closed 7 years ago

move layout/base tests that depend heavily on enablePrivilege to mochitest-chrome

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jmaher, Assigned: jmaher)

References

Details

(Whiteboard: [specialpowers])

Attachments

(1 file, 1 obsolete file)

there are 2 tests which are run from test_reftests_with_caret.html which make extensive use of enablePrivilege.  We can move these to mochitest chrome and run them inside of test_reftests_with_caret.html there.
Assignee: nobody → jmaher
Attachment #539217 - Flags: review?(ehsan)
Comment on attachment 539217 [details] [diff] [review]
move layout/base/ tests that use a lot of enablePrivilege to chrome (1.0)

Can you please move *all* of these tests to mochitest-chrome?  This will make it really hard to run both set of tests when I touch caret code.
Attachment #539217 - Flags: review?(ehsan) → review-
moved all the tests used by test_reftest_with_caret.html to chrome.  Tests are green on try as well
Attachment #539217 - Attachment is obsolete: true
Attachment #540309 - Flags: review?(ehsan)
Comment on attachment 540309 [details] [diff] [review]
move layout/base/tests/test_reftest_with_caret.html and tests to chrome (1.0)

Boy, do these renames suck!

> function runTests() {
>   try {
>     SimpleTest.waitForExplicitFinish();
>-
>     netscape.security.PrivilegeManager.enablePrivilege(
>-      'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
>+     'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');

Hmm, can't we get rid of this too?  (If not, why is it needed?)

r=me with that removed.
Attachment #540309 - Flags: review?(ehsan) → review+
http://hg.mozilla.org/mozilla-central/rev/ae2dbbb7b935
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
I had to back this patch out:

http://hg.mozilla.org/integration/mozilla-inbound/rev/65a94e646ad8

The problem is that here <http://hg.mozilla.org/mozilla-central/file/ae2dbbb7b935/layout/base/tests/chrome/bug613433-1.html#l17> we simulate a backspace key press.  In mochitest-chrome, this event bubbles up to the browser chrome, and triggers the back command, which means that the test is aborted prematurely, and we're losing test coverage with the patch as landed here.

I think the best option here is to use specialpowers APIs instead of moving the test to mochitest-chrome.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Depends on: 667217
originally the intention was to move just the two tests: 
bug585922.html
bug613807-1.html

we can move these, but we will have to duplicate test_reftest_with_caret.html which is sort of ugly.  Although we could be smarter about this.

Ideas?
(In reply to comment #7)
> originally the intention was to move just the two tests: 
> bug585922.html
> bug613807-1.html
> 
> we can move these, but we will have to duplicate test_reftest_with_caret.html
> which is sort of ugly.  Although we could be smarter about this.
> 
> Ideas?

Can't we just add a SpecialPowers API to get the editor object from a text control and use that without moving the tests?
do we still wantto do this?  I am inclined to mark this as wontfix.
Nope!
Status: REOPENED → RESOLVED
Closed: 11 years ago7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.