Closed Bug 597481 Opened 14 years ago Closed 14 years ago

tab pinning tests fail on Firefox 3.6

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: peregrino)

References

Details

Attachments

(1 file, 1 obsolete file)

The tab pinning tests fail on Firefox 3.6, presumably because Firefox 3.6 doesn't have pinning functionality, and the tests don't take that into account.

Hernán said he'd be able to take a look at this, so assigning it to him.

Here is the output:

error: An exception occurred.
Traceback (most recent call last):
  File "resource://jetpack-core-jetpack-core-lib/timer.js", line 60, in notify
    this._callback.apply(null, this._params);
  File "resource://jetpack-core-jetpack-core-tests/test-tabs.js", line 579, in 
    callback(window, browsers[0]);
  File "resource://jetpack-core-jetpack-core-tests/test-tabs.js", line 226, in 
    onOpen: function(tab) {
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 404, in TM_open
    open(options, tabConstructor, window);
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 530, in open
    openURLInNewTab(options, win, tabConstructor);
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 561, in openURLInNewTab
    window.gBrowser.pinTab(tabEl);
TypeError: window.gBrowser.pinTab is not a function
console: [JavaScript Error: "labelGetUbuntu is null" {file: "chrome://ubufox/content/overlay.js" line: 82}]
error: TEST FAILED: test-tabs.testOpenPinned (timed out)
console: [JavaScript Error: "labelGetUbuntu is null" {file: "chrome://ubufox/content/overlay.js" line: 82}]
error: An exception occurred.
Traceback (most recent call last):
  File "resource://jetpack-core-jetpack-core-lib/timer.js", line 60, in notify
    this._callback.apply(null, this._params);
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 570, in 
    require("errors").catchAndLog(function(tab) options.onOpen(tab))(tab);
  File "resource://jetpack-core-jetpack-core-lib/errors.js", line 49, in 
    return callback.apply(this, arguments);
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 570, in 
    require("errors").catchAndLog(function(tab) options.onOpen(tab))(tab);
  File "resource://jetpack-core-jetpack-core-tests/test-tabs.js", line 243, in 
    tab.pin();
  File "resource://jetpack-core-jetpack-core-lib/tab-browser.js", line 366, in 
    this.pin = function() win.gBrowser.pinTab(element);
TypeError: win.gBrowser.pinTab is not a function
Comment on attachment 476482 [details] [diff] [review]
Set the tests' code inside try/catch statements so that they don't fail in 3.6

Hmm, this seems ok, but it might be misleading if a different problem causes an exception.  So instead of catching the exception, check that the version of the application is new enough to support app tabs via code like the following:

  const xulApp = require("xul-app");
  if (xulApp.versionInRange(xulApp.platformVersion, "2.0b2", "*") {
    // test tab pinning
  }
  else {
    test.pass("Pinned tabs are not supported in this application.");
  }
Attachment #476482 - Flags: review?(myk) → review-
Myk, I added version checking as you indicated. Thanks for the hint, I didn't know that module!

Hernán
Attachment #476482 - Attachment is obsolete: true
Attachment #476791 - Flags: review?(myk)
Comment on attachment 476791 [details] [diff] [review]
Added version checking to the pin/unpin testing as Myk indicated

Looks and works great! r=myk
Attachment #476791 - Flags: review?(myk) → review+
Keywords: checkin-needed
Fixed by changeset https://hg.mozilla.org/labs/jetpack-sdk/rev/fddd8ffe5229.

Thanks for the fix!
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: