Closed Bug 863502 Opened 12 years ago Closed 11 years ago

tests/test-tab-events.test open fails on Fennec

Categories

(Add-on SDK Graveyard :: General, defect, P1)

ARM
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mossop, Assigned: jsantell)

References

Details

Attachments

(2 files)

error: addon-sdk: fail: undefined info: addon-sdk: Traceback (most recent call last): File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/timers.js", line 31, in notify callback.apply(null, args); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 294, in null timer.setTimeout(function() { onDone(self); }, 0); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 470, in null options.onDone(self); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 452, in runNextTest self.start({test: test, onDone: runNextTest}); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 483, in start this.test.testFunction(this); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/test.js", line 64, in null test(assert, function() { File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path.tests/test-tab-events.js", line 29, in null win.then(function(w) { File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 155, in then result.then(resolve, reject); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 45, in then return { then: function then(fulfill) { fulfill(value); } }; File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 120, in resolve deferred.resolve(onFulfill ? onFulfill(value) : value); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path.tests/test-tab-events.js", line 32, in null return scenario(assert, window, actual); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path.tests/test-tab-events.js", line 49, in exports["test current window"]< assert.equal(open.target, tab); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/test/assert.js", line 125, in equal operator: "==" File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/test/assert.js", line 89, in fail this._log.fail(message); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 88, in fail this.console.trace(); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/lang/functional.js", line 71, in null return function() fn.apply(this, args.concat(Array.slice(arguments))); error: addon-sdk: fail: select is undefined info: addon-sdk: Traceback (most recent call last): File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/timers.js", line 31, in notify callback.apply(null, args); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 294, in null timer.setTimeout(function() { onDone(self); }, 0); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 470, in null options.onDone(self); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 452, in runNextTest self.start({test: test, onDone: runNextTest}); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 483, in start this.test.testFunction(this); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/test.js", line 64, in null test(assert, function() { File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path.tests/test-tab-events.js", line 36, in null }).then(done, assert.fail); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 155, in then result.then(resolve, reject); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 54, in then return { then: function then(fulfill, reject) { reject(reason); } }; File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/core/promise.js", line 135, in reject if (onError) deferred.resolve(onError(reason)); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/test/assert.js", line 89, in fail this._log.fail(message); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/deprecated/unit-test.js", line 88, in fail this.console.trace(); File "resource://extensions.modules.9ad1c223-986f-4c0b-9c15-0dc5a7e91acc-at-jetpack.commonjs.path/sdk/lang/functional.js", line 71, in null return function() fn.apply(this, args.concat(Array.slice(arguments)));
Irakli, you added this test. Care to take a look?
Some some investigation here and there are two bugs. First the TabOpen etc. events on Fennec don't have the tab object as the event.target as this test expects, instead they have the browser element. We can get the tab object through window.BrowserApp. Second the tab open and close aren't synchronous, we have to wait until they have completed.
Attached file WIP
Non-functional patch, but the events are fixed I think.
Assignee: nobody → evold
Assignee: evold → nobody
Blocks: 893191
Assignee: nobody → jsantell
Assignee: jsantell → evold
I'm going to focus on Toolbars so I can move on to the cfx-js project.
Assignee: evold → nobody
Assignee: nobody → jsantell
Attached file GH PR 1130
Since Firefox's events are fired before the utils.openTab expression is even returned (giving us access to the tabs), and Fennec's are async like Dave said (and in different order than Firefox), here's a solution.
Attachment #779542 - Flags: review?(evold)
Comment on attachment 779542 [details] GH PR 1130 Irakli can you review this? the module doesn't appear to be used anywhere, and I'm not sure what the plan is for it.
Attachment #779542 - Flags: review?(evold) → review?(rFobic)
Comment on attachment 779542 [details] GH PR 1130 I find new test API too confusing, please make it little more obvious. Other than that it looks fine by me.
Attachment #779542 - Flags: review?(rFobic) → review-
Comment on attachment 779542 [details] GH PR 1130 Refactored tests as discussed in PR
Attachment #779542 - Flags: review- → review?(rFobic)
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/131927a1d7a3ea739557348826a3f42289cc9eb0 bug 863502 fix fennec test-tab-events https://github.com/mozilla/addon-sdk/commit/3bf8e3fc7ce1c39cf12b07dc79f6f3a6ae4f3428 Merge pull request #1130 from jsantell/863502-fennec-tab-events-fix Fix bug 863502, fennec test-tab-events, r=@gozala
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: