Closed Bug 607126 Opened 9 years ago Closed 9 years ago

test-app-strings.testStringBundle fails with exception

Categories

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

x86
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Unassigned)

References

Details

Attachments

(1 obsolete file)

test-app-strings.testStringBundle fails with "Error: String 'ExtensionCapability' could not be retrieved from the bundle due to an unknown error (it doesn't exist?).":

--------------------------------------------------------------------------------
Using binary at '/home/myk/bin/firefox'.
Using profile at '/tmp/tmpSFIGhh.mozrunner'.

(firefox-bin:5398): GLib-WARNING **: g_set_prgname() called multiple times
..error: TEST FAILED: test-app-strings.testStringBundle (exception)
error: An exception occurred.
Traceback (most recent call last):
  File "chrome://browser/content/browser.js", line 6539, in delayedStartup
    .init(window);
  File "jar:file:///home/myk/Applications/firefox-trunk/omni.jar!/components/nsSessionStore.js", line 389, in sss_init
    this.onLoad(aWindow);
  File "jar:file:///home/myk/Applications/firefox-trunk/omni.jar!/components/nsSessionStore.js", line 727, in sss_onLoad
    Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
  File "file:///tmp/tmpSFIGhh.mozrunner/extensions/xulapp@toolness.com/components/harness.js", line 385, in Harness_observe
    this.load(lifeCycleObserver192.loadReason || "startup");
  File "file:///tmp/tmpSFIGhh.mozrunner/extensions/xulapp@toolness.com/components/harness.js", line 317, in Harness_load
    obSvc.notifyObservers(null, APP_READY_TOPIC, null);
  File "resource://jetpack-core-jetpack-core-lib/observer-service.js", line 174, in 
    this.callback(subject, data);
  File "resource://jetpack-core-test-harness-lib/run-tests.js", line 106, in doRunTests
    callbacks.print);
  File "resource://jetpack-core-test-harness-lib/run-tests.js", line 69, in runTests
    onDone: onDone});
  File "resource://jetpack-core-test-harness-lib/harness.js", line 367, in runTests
    nextIteration();
  File "resource://jetpack-core-test-harness-lib/harness.js", line 286, in nextIteration
    onDone: nextIteration});
  File "resource://jetpack-core-jetpack-core-lib/unit-test.js", line 50, in findAndRunTests
    onDone: options.onDone});
  File "resource://jetpack-core-jetpack-core-lib/unit-test.js", line 284, in startMany
    runNextTest(this);
  File "resource://jetpack-core-jetpack-core-lib/unit-test.js", line 280, in runNextTest
    self.start({test: test, onDone: runNextTest});
  File "resource://jetpack-core-jetpack-core-lib/unit-test.js", line 298, in start
    this.test.testFunction(this);
  File "resource://jetpack-core-jetpack-core-lib/unit-test.js", line 63, in runTest
    test(runner);
  File "resource://jetpack-core-jetpack-core-tests/test-app-strings.js", line 26, in 
    test.assertEqual(strings.get(name, args),
  File "resource://jetpack-core-jetpack-core-lib/app-strings.js", line 75, in strings_get
    "bundle due to an unknown error (it doesn't exist?).");
Error: String 'ExtensionCapability' could not be retrieved from the bundle due to an unknown error (it doesn't exist?).

2 of 3 tests passed.
FAIL
Total time: 1.469193 seconds
Program terminated unsuccessfully.
--------------------------------------------------------------------------------

The original exception is |[Exception... "Cannot convert JavaScript object into an array arg 1 [nsIStringBundle.formatStringFromName]"  nsresult: "0x80570023 (NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY)"|, which is thrown by app-strings.js line 67 <http://github.com/mozilla/addon-sdk/blob/master/packages/jetpack-core/lib/app-strings.js#L67>, which calls nsIStringBundle::formatStringFromName, passing it the array ["foo"], which it obtained from test-app-strings.js line 25 <http://github.com/mozilla/addon-sdk/blob/master/packages/jetpack-core/tests/test-app-strings.js#L25>.

So the array causing the failure is passed into the module from another module (and hence another JavaScript context).  On Firefox 4.0b6, Array.isArray on that array returns true; on trunk, it returns false.  Perhaps that's the reason it is being treated as an object rather than an array by XPConnect?

In theory, the Array.isArray problem is bug 606875, but that has been refocused on Object.prototype.toString returning [object Object] instead of [object Array] for arrays.  Nevertheless, it's not clear whether the problem is Array.isArray, Object.prototype.toString, or something else entirely.  In the meantime, prospectively setting a dependency on that bug.
This may be a dupe of bug 604523. If so, the fix for that bug has landed over the weekend, so could you try testing again with the latest tracemonkey build?

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-tracemonkey/
Depends on: 604523
(In reply to comment #1)
> This may be a dupe of bug 604523.

I would say rather that it depends on that bug, since this bug is about the test failure, while that one is about the potential underlying cause of the failure.

> If so, the fix for that bug has landed over
> the weekend, so could you try testing again with the latest tracemonkey build?
> 
> http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-tracemonkey/

All tests work with that build.
Attachment #485885 - Attachment description: verbose test log → verbose test log - wrong bug, please ignore
Attachment #485885 - Attachment is obsolete: true
Bug 604523 landed on trunk yesterday, and more tests work with today's nightly builds, but some tests still fail, so perhaps bug 606523 and/or bug 607284 are also involved here?  Both of those are scheduled to land today, so we can test against tomorrow's nightlies tomorrow to see if those fixes resolve the rest of the problems here.
The platform fixes that landed have fixed this bug.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to comment #3)
> Bug 604523 landed on trunk yesterday, and more tests work with today's nightly
> builds, but some tests still fail, so perhaps bug 606523

Erm, I meant bug 606573.
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.