Bug 1021312 - Tests. r=mccr8
authorBobby Holley <bobbyholley@gmail.com>
Thu, 05 Jun 2014 22:32:36 -0700
changeset 207322 340e016163edcf0fb2b9c1183d4ecda7b6707cf4
parent 207321 08045ba9192ff0c932fb0f7b07d937384e18036d
child 207323 06e276460c5b32ee7254536fc7e211ea13de7f94
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1021312
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1021312 - Tests. r=mccr8
js/xpconnect/tests/unit/test_bug1021312.js
js/xpconnect/tests/unit/xpcshell.ini
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/tests/unit/test_bug1021312.js
@@ -0,0 +1,16 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const Cu = Components.utils;
+function run_test() {
+  let sb = new Cu.Sandbox(this);
+  var called = false;
+
+  Cu.exportFunction(function(str) { do_check_true(str, "someString"); called = true; },
+                    sb, { defineAs: "func" });
+  // Do something weird with the string to make sure that it doesn't get interned.
+  Cu.evalInSandbox("var str = 'someString'; for (var i = 0; i < 10; ++i) str += i;", sb);
+  Cu.evalInSandbox("func(str);", sb);
+  do_check_true(called);
+}
--- a/js/xpconnect/tests/unit/xpcshell.ini
+++ b/js/xpconnect/tests/unit/xpcshell.ini
@@ -37,16 +37,17 @@ support-files =
 [test_bug854558.js]
 [test_bug868675.js]
 [test_bug867486.js]
 [test_bug872772.js]
 [test_bug885800.js]
 [test_bug961054.js]
 [test_bug976151.js]
 [test_bug1001094.js]
+[test_bug1021312.js]
 [test_bug_442086.js]
 [test_file.js]
 [test_blob.js]
 [test_blob2.js]
 [test_file2.js]
 [test_import.js]
 [test_import_fail.js]
 [test_isModuleLoaded.js]