Closed
Bug 803065
Opened 12 years ago
Closed 12 years ago
on Fennec `tabs` module doesn't work in unit test as it works in add-on code
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: zer0, Assigned: evold)
References
Details
Attachments
(1 file)
If you write the code below in main.js and run on Fennec:
require("tabs").open({
url: "data:text/html,<h1>Hello from add-on</h1>"
});
It works perfectly fine, opening a tab with an heading saying "Hello from add-on". However, the same code in a unit test:
exports["test tabs"] = function(assert, done) {
require("tabs").open({
url: "data:text/html,<h1>Hello from test</h1>"
});
// the `done` call is omitted to have time to
// look at the result
};
A new tab is opened, but it's blank.
I run these code on Samsung Galaxy Tab 10.1 and both Firefox release (16.0) and Nightly (19.0a1)
Reporter | ||
Comment 1•12 years ago
|
||
I removed the dependency from bug 802215 because the issue is not related. To be clear, fix that bug doesn't solve anything here due the fact that the same issue is present in the `test-tabs`, however because access to the tab's content is not critical to those tests, they passes.
I also removed the dependency from bug 803031 because, even if the re-implementation of selection module makes it working on Fennec mostly "as is", due the issue with `tabs` is not possible test it properly. So I will keep this bug separated, and I finalize it as soon `tabs` will work on Fennec also in unit testing.
Reporter | ||
Comment 2•12 years ago
|
||
Sorry, skip the second part of the comment, ("I also...") It was mean to be in another bug. This bug still blocks the implementation of Selection module on Fennec.
Blocks: 803031
Assignee | ||
Comment 3•12 years ago
|
||
This logs correct html, and also fails to display the content.. tho I notice the content is displayed in the tab bar..
exports.testTabs = function(test) {
test.waitUntilDone();
require("tabs").open({
// url: "data:text/html,<h1>Hello</h1>",
url: 'data:text/html;charset=utf-8,<html><head><title>Hi</title></head><body><h1>asdfasdfasdf</h1></body></html>',
onReady: function(tab) {
tab.attach({
contentScript: "self.postMessage(document.body.innerHTML)",
onMessage: function(html) {
console.log("message!")
console.log(html);
}
});
}
});
};
Assignee | ||
Comment 4•12 years ago
|
||
I think this may be because cfx test opens a window that merely says "Running Tests" which isn't displayed on Fennec, but I see it oddly displayed when I play around with the test in comment 3 so I am pretty sure it exists, and it shouldn't.. Assuming it is displayed I could understand that it prevents painting on the main window.
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Erik Vold [:erikvold] from comment #4)
> I think this may be because cfx test opens a window that merely says
> "Running Tests" which isn't displayed on Fennec, but I see it oddly
> displayed when I play around with the test in comment 3 so I am pretty sure
> it exists, and it shouldn't.. Assuming it is displayed I could understand
> that it prevents painting on the main window.
Ah intuition always points the way! This is the problem, so the question is do we really need that window for Firefox?..
Assignee | ||
Comment 6•12 years ago
|
||
Pointer to Github pull-request
Assignee | ||
Updated•12 years ago
|
Attachment #672857 -
Flags: review?(rFobic)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → evold
Priority: -- → P1
Updated•12 years ago
|
Attachment #672857 -
Flags: review?(rFobic) → review+
Comment 7•12 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/8ac61592ad337e9ec03cd1946cf981162441b77c
Bug 803065 Running Tests window cannot be used on Fennec, and is not needed
https://github.com/mozilla/addon-sdk/commit/f4291b6472154021fbf8bce6386d690c2e62251d
Merge pull request #622 from erikvold/803065
Fix Bug 803065 Running Tests window cannot be used on Fennec, and is not needed r=@gozala
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 805233
Assignee | ||
Comment 8•12 years ago
|
||
something broke here https://tbpl.mozilla.org/?tree=Jetpack&rev=f0b53ebfdc8e
Reporter | ||
Comment 9•12 years ago
|
||
I believe because the last comment of Erik and its revert (https://github.com/mozilla/addon-sdk/commit/062444b7e29d85a229620b40c7cfd17dae65b4f1) this bug should be reopened.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 10•12 years ago
|
||
Commit pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/6fa7e7b9b07c768637a5df106d83f9b245f5c743
Merge pull request #657 from erikvold/803065
Fix Bug 803065 again (ignoring windows that are not part of test in testTrackWindows) r=@gozala
Updated•12 years ago
|
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•