Closed Bug 1215846 Opened 10 years ago Closed 10 years ago

Replace JS1.7 legacy generators with ES6 generators in toolkit/components/places

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: evilpies, Assigned: evilpies)

References

Details

Attachments

(3 files, 1 obsolete file)

No description provided.
Please have a look at toolkit/components/places/tests/unit/test_history_notifications.js, with this patch the test fails, but as far as I can tell it never executed before.
Attachment #8678472 - Flags: review?(mak77)
(In reply to Tom Schuster [:evilpie] from comment #1) > Please have a look at > toolkit/components/places/tests/unit/test_history_notifications.js, with > this patch the test fails, but as far as I can tell it never executed before. Mixing up add_task and do_test_pending is not a great idea, they are 2 different ways to manage async tests (one new, one old) and I suspect they don't work well together at all, I think I may also have filed a bug in the past to explicitly fail tests mixing the two systems. You should remove run_test completely and change the test to properly yield on a promise. Why do you think it never executed? wouldn't it timeout due to do_test_pending if it didn't run to completion?
Flags: needinfo?(evilpies)
Comment on attachment 8678472 [details] [diff] [review] Replace legacy generators in toolkit/components/places Review of attachment 8678472 [details] [diff] [review]: ----------------------------------------------------------------- apart from what I said in previous comment, the other changes look good.
Attachment #8678472 - Flags: review?(mak77) → review+
(In reply to Marco Bonardo [::mak] from comment #2) > You should remove run_test completely and change the test to properly yield > on a promise. I have zero ideas how that would look like. > Why do you think it never executed? wouldn't it timeout due to > do_test_pending if it didn't run to completion? I think that, because it doesn't produce any output and it's basically only two lines. 0:00.48 LOG: Thread-1 INFO (xpcshell/head.js) | test MAIN run_test pending (1) 0:00.48 LOG: Thread-1 INFO (xpcshell/head.js) | test MAIN run_test finished (1) Removing do_test_finished() from the test doesn't change anything. Adding do_check_true(false) before it doesn't either.
Flags: needinfo?(evilpies)
Sorry I forgot about this, let me try to fix that test locally.
Flags: needinfo?(mak77)
this should do
Flags: needinfo?(mak77)
Attachment #8683619 - Flags: review?(evilpies)
Comment on attachment 8683619 [details] [diff] [review] fix test_history_notifications.js ehr I forgot a qref
Attachment #8683619 - Attachment is obsolete: true
Attachment #8683619 - Flags: review?(evilpies)
Attachment #8683626 - Flags: review?(evilpies)
Summary: Replace JS1.7 legacy generators with ES6 generators in toolkit/ → Replace JS1.7 legacy generators with ES6 generators in toolkit/components/places
Comment on attachment 8683626 [details] [diff] [review] fix test_history_notifications.js Review of attachment 8683626 [details] [diff] [review]: ----------------------------------------------------------------- Thank you for helping me out! ::: toolkit/components/places/tests/unit/test_history_notifications.js @@ -65,5 @@ > > - // Make sure that the incorrectly opened service is closed before > - // we make another attempt. Otherwise, there will be a conflict between > - // the two services (and an assertion failure). > - yield shutdownPlaces(); So this is not needed anymore?
Attachment #8683626 - Flags: review?(evilpies) → review+
I didn't notice any issues without it, so I guess it's not needed anymore.
Ups, seems like I forgot to update places/tests/browser/browser_colorAnalyzer.js properly.
Attachment #8683860 - Flags: review?(mak77)
Comment on attachment 8683860 [details] [diff] [review] fix browser_colorAnalyzer Review of attachment 8683860 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/places/tests/browser/browser_colorAnalyzer.js @@ +58,1 @@ > // simple test - draw a red box in the center, make sure we get red back nit: you added some newlines here and there that don't look useful off-hand @@ -316,5 @@ > - }, function(actual) { > - info("perfBigImage: " + ((new Date()) - t1) + "ms"); > - nextStep(); > - }, "", true); > -}); why did you just remove the perf tests? I think someone added them to annotate them somewhere (this code is in Places but it shouldn't, so I can't give reasoning)... what about just commenting them out?
Attachment #8683860 - Flags: review?(mak77) → review+
The way the test was written doesn't work well with yield and promises. And performance tests in normal test suites are usually a bad idea anyway. If somebody wants the code back they can just look at the history.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: