Bug 824254 - Fix intermittent browser_gcli_keyboard.js test; r=mratcliffe
authorJoe Walker <jwalker@mozilla.com>
Tue, 21 May 2013 10:18:55 +0100
changeset 143914 99a40b3cf2ec96c18d6d01b010f67bc3002cc24b
parent 143913 3b90dbff58096d79c8c32343e8c0b1df8b0fe250
child 143915 f83487d9a97a06efd78323a32b9e41e0f7ced7a8
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmratcliffe
bugs824254
milestone24.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 824254 - Fix intermittent browser_gcli_keyboard.js test; r=mratcliffe
browser/devtools/commandline/test/Makefile.in
browser/devtools/commandline/test/browser_gcli_keyboard.js
browser/devtools/commandline/test/browser_gcli_keyboard1.js
browser/devtools/commandline/test/browser_gcli_keyboard2.js
browser/devtools/commandline/test/browser_gcli_keyboard3.js
--- a/browser/devtools/commandline/test/Makefile.in
+++ b/browser/devtools/commandline/test/Makefile.in
@@ -47,17 +47,19 @@ MOCHITEST_BROWSER_FILES = \
   browser_gcli_completion.js \
   browser_gcli_exec.js \
   browser_gcli_focus.js \
   browser_gcli_history.js \
   browser_gcli_incomplete.js \
   browser_gcli_inputter.js \
   browser_gcli_intro.js \
   browser_gcli_js.js \
-  browser_gcli_keyboard.js \
+  browser_gcli_keyboard1.js \
+  browser_gcli_keyboard2.js \
+  browser_gcli_keyboard3.js \
   browser_gcli_menu.js \
   browser_gcli_node.js \
   browser_gcli_resource.js \
   browser_gcli_scratchpad.js \
   browser_gcli_spell.js \
   browser_gcli_split.js \
   browser_gcli_tokenize.js \
   browser_gcli_tooltip.js \
new file mode 100644
--- /dev/null
+++ b/browser/devtools/commandline/test/browser_gcli_keyboard1.js
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2012, Mozilla Foundation and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// define(function(require, exports, module) {
+
+// <INJECTED SOURCE:START>
+
+// THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
+// DO NOT EDIT IT DIRECTLY
+
+var exports = {};
+
+const TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testKeyboard1.js</p>";
+
+function test() {
+  helpers.addTabWithToolbar(TEST_URI, function(options) {
+    return helpers.runTests(options, exports);
+  }).then(finish);
+}
+
+// <INJECTED SOURCE:END>
+
+'use strict';
+
+// var helpers = require('gclitest/helpers');
+// var mockCommands = require('gclitest/mockCommands');
+
+exports.setup = function(options) {
+  mockCommands.setup();
+};
+
+exports.shutdown = function(options) {
+  mockCommands.shutdown();
+};
+
+exports.testComplete = function(options) {
+  return helpers.audit(options, [
+    {
+      setup: 'tsn e<DOWN><DOWN><DOWN><DOWN><DOWN><TAB>',
+      check: { input: 'tsn exte ' }
+    },
+    {
+      setup: 'tsn e<DOWN><DOWN><DOWN><DOWN><TAB>',
+      check: { input: 'tsn ext ' }
+    },
+    {
+      setup: 'tsn e<DOWN><DOWN><DOWN><TAB>',
+      check: { input: 'tsn extend ' }
+    },
+    {
+      setup: 'tsn e<DOWN><DOWN><TAB>',
+      check: { input: 'tsn exten ' }
+    },
+    {
+      setup: 'tsn e<DOWN><TAB>',
+      check: { input: 'tsn exte ' }
+    },
+    {
+      setup: 'tsn e<TAB>',
+      check: { input: 'tsn ext ' }
+    },
+    {
+      setup: 'tsn e<UP><TAB>',
+      check: { input: 'tsn extend ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><TAB>',
+      check: { input: 'tsn exten ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><TAB>',
+      check: { input: 'tsn exte ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><UP><TAB>',
+      check: { input: 'tsn ext ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><UP><UP><TAB>',
+      check: { input: 'tsn extend ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><UP><UP><UP><TAB>',
+      check: { input: 'tsn exten ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><UP><UP><UP><UP><TAB>',
+      check: { input: 'tsn exte ' }
+    },
+    {
+      setup: 'tsn e<UP><UP><UP><UP><UP><UP><UP><UP><TAB>',
+      check: { input: 'tsn ext ' }
+    }
+  ]);
+};
+
+
+// });
rename from browser/devtools/commandline/test/browser_gcli_keyboard.js
rename to browser/devtools/commandline/test/browser_gcli_keyboard2.js
--- a/browser/devtools/commandline/test/browser_gcli_keyboard.js
+++ b/browser/devtools/commandline/test/browser_gcli_keyboard2.js
@@ -18,46 +18,36 @@
 
 // <INJECTED SOURCE:START>
 
 // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
 // DO NOT EDIT IT DIRECTLY
 
 var exports = {};
 
-const TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testKeyboard.js</p>";
+const TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testKeyboard2.js</p>";
 
 function test() {
   helpers.addTabWithToolbar(TEST_URI, function(options) {
     return helpers.runTests(options, exports);
   }).then(finish);
 }
 
 // <INJECTED SOURCE:END>
 
 'use strict';
 
-var javascript = require('gcli/types/javascript');
 // var helpers = require('gclitest/helpers');
 // var mockCommands = require('gclitest/mockCommands');
-var canon = require('gcli/canon');
-
-var tempWindow = undefined;
 
 exports.setup = function(options) {
   mockCommands.setup();
-
-  tempWindow = javascript.getGlobalObject();
-  javascript.setGlobalObject(options.window);
 };
 
 exports.shutdown = function(options) {
-  javascript.setGlobalObject(tempWindow);
-  tempWindow = undefined;
-
   mockCommands.shutdown();
 };
 
 // Bug 664377: Add tests for internal completion. i.e. "tsela<TAB> 1"
 
 exports.testSimple = function(options) {
   return helpers.audit(options, [
     {
@@ -70,108 +60,16 @@ exports.testSimple = function(options) {
     },
     {
       setup: 'tsg a<TAB>',
       check: { input: 'tsg aaa ', cursor: 8 }
     }
   ]);
 };
 
-exports.testComplete = function(options) {
-  return helpers.audit(options, [
-    {
-      setup: 'tsn e<DOWN><DOWN><DOWN><DOWN><DOWN><TAB>',
-      check: { input: 'tsn exte ' }
-    },
-    {
-      setup: 'tsn e<DOWN><DOWN><DOWN><DOWN><TAB>',
-      check: { input: 'tsn ext ' }
-    },
-    {
-      setup: 'tsn e<DOWN><DOWN><DOWN><TAB>',
-      check: { input: 'tsn extend ' }
-    },
-    {
-      setup: 'tsn e<DOWN><DOWN><TAB>',
-      check: { input: 'tsn exten ' }
-    },
-    {
-      setup: 'tsn e<DOWN><TAB>',
-      check: { input: 'tsn exte ' }
-    },
-    {
-      setup: 'tsn e<TAB>',
-      check: { input: 'tsn ext ' }
-    },
-    {
-      setup: 'tsn e<UP><TAB>',
-      check: { input: 'tsn extend ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><TAB>',
-      check: { input: 'tsn exten ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><TAB>',
-      check: { input: 'tsn exte ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><UP><TAB>',
-      check: { input: 'tsn ext ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><UP><UP><TAB>',
-      check: { input: 'tsn extend ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><UP><UP><UP><TAB>',
-      check: { input: 'tsn exten ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><UP><UP><UP><UP><TAB>',
-      check: { input: 'tsn exte ' }
-    },
-    {
-      setup: 'tsn e<UP><UP><UP><UP><UP><UP><UP><UP><TAB>',
-      check: { input: 'tsn ext ' }
-    }
-  ]);
-};
-
-exports.testScript = function(options) {
-  return helpers.audit(options, [
-    {
-      skipIf: function commandJsMissing() {
-        return canon.getCommand('{') == null;
-      },
-      setup: '{ wind<TAB>',
-      check: { input: '{ window' }
-    },
-    {
-      skipIf: function commandJsMissing() {
-        return canon.getCommand('{') == null;
-      },
-      setup: '{ window.docum<TAB>',
-      check: { input: '{ window.document' }
-    }
-  ]);
-};
-
-exports.testJsdom = function(options) {
-  return helpers.audit(options, [
-    {
-      skipIf: function jsDomOrCommandJsMissing() {
-        return options.isJsdom || canon.getCommand('{') == null;
-      },
-      setup: '{ window.document.titl<TAB>',
-      check: { input: '{ window.document.title ' }
-    }
-  ]);
-};
-
 exports.testIncr = function(options) {
   return helpers.audit(options, [
     /*
     // We currently refuse to increment/decrement things with a non-valid
     // status which makes sense for many cases, and is a decent default.
     // However in theory we could do better, these tests are there for then
     {
       setup: 'tsu -70<UP>',
new file mode 100644
--- /dev/null
+++ b/browser/devtools/commandline/test/browser_gcli_keyboard3.js
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2012, Mozilla Foundation and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// define(function(require, exports, module) {
+
+// <INJECTED SOURCE:START>
+
+// THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
+// DO NOT EDIT IT DIRECTLY
+
+var exports = {};
+
+const TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testKeyboard3.js</p>";
+
+function test() {
+  helpers.addTabWithToolbar(TEST_URI, function(options) {
+    return helpers.runTests(options, exports);
+  }).then(finish);
+}
+
+// <INJECTED SOURCE:END>
+
+'use strict';
+
+var javascript = require('gcli/types/javascript');
+// var helpers = require('gclitest/helpers');
+// var mockCommands = require('gclitest/mockCommands');
+var canon = require('gcli/canon');
+
+var tempWindow = undefined;
+
+exports.setup = function(options) {
+  mockCommands.setup();
+
+  tempWindow = javascript.getGlobalObject();
+  javascript.setGlobalObject(options.window);
+};
+
+exports.shutdown = function(options) {
+  javascript.setGlobalObject(tempWindow);
+  tempWindow = undefined;
+
+  mockCommands.shutdown();
+};
+
+exports.testScript = function(options) {
+  return helpers.audit(options, [
+    {
+      skipIf: function commandJsMissing() {
+        return canon.getCommand('{') == null;
+      },
+      setup: '{ wind<TAB>',
+      check: { input: '{ window' }
+    },
+    {
+      skipIf: function commandJsMissing() {
+        return canon.getCommand('{') == null;
+      },
+      setup: '{ window.docum<TAB>',
+      check: { input: '{ window.document' }
+    }
+  ]);
+};
+
+exports.testJsdom = function(options) {
+  return helpers.audit(options, [
+    {
+      skipIf: function jsDomOrCommandJsMissing() {
+        return options.isJsdom || canon.getCommand('{') == null;
+      },
+      setup: '{ window.document.titl<TAB>',
+      check: { input: '{ window.document.title ' }
+    }
+  ]);
+};
+
+
+// });