Bug 899080 - Test fixup part 5 - layout. r=roc
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Wed, 04 Sep 2013 16:07:53 +0200
changeset 145521 1332d461d52ec7febce82c286011b5933ad7216d
parent 145520 af8b8c91286c2279b5f3b4fd37466f1cedb0f1fb
child 145522 1c3c7005f6af6f078def0533ae6a1890fdc48df4
push id33305
push usergeorg.fritzsche@googlemail.com
push dateWed, 04 Sep 2013 21:10:31 +0000
treeherdermozilla-inbound@1e63861a73d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs899080
milestone26.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 899080 - Test fixup part 5 - layout. r=roc
layout/base/tests/Makefile.in
layout/base/tests/enableTestPlugin.js
layout/base/tests/test_bug629838.html
layout/base/tests/test_mozPaintCount.html
layout/generic/test/Makefile.in
layout/generic/test/test_invalidate_during_plugin_paint.html
layout/generic/test/test_plugin_focus.html
layout/generic/test/test_plugin_mouse_coords.html
--- a/layout/base/tests/Makefile.in
+++ b/layout/base/tests/Makefile.in
@@ -146,16 +146,17 @@ MOCHITEST_FILES =	\
 		test_bug842853-2.html \
 		  file_bug842853.sjs \
 		  file_bug842853.html \
 		test_bug849219.html \
 		test_bug851485.html \
 		test_bug851445.html \
 		  bug851445_helper.html \
 		test_emulateMedium.html \
+		enableTestPlugin.js \
 		$(NULL)
 
 ifeq (,$(filter gonk,$(MOZ_WIDGET_TOOLKIT)))
 # THESE TESTS (BELOW) DO NOT RUN ON B2G
 MOCHITEST_FILES += \
 		test_bug858459.html \
 		$(NULL)
 # THESE TESTS (ABOVE) DO NOT RUN ON B2G
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/enableTestPlugin.js
@@ -0,0 +1,25 @@
+// this automatically sets the test plugin to be enabled (not e.g. click-to-play)
+// and resets this afterwards
+
+(function() {
+  function getTestPlugin(aPluginName) {
+    var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
+                          .getService(SpecialPowers.Ci.nsIPluginHost);
+    var tags = ph.getPluginTags();
+    for (var tag of tags) {
+      if (tag.name == aPluginName) {
+       return tag;
+      }
+    }
+
+    ok(false, "Could not find plugin tag with plugin name '" + name + "'");
+    return null;
+  }
+
+  var plugin = getTestPlugin("Test Plug-in");
+  var oldEnabledState = plugin.enabledState;
+  plugin.enabledState = SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED;
+  SimpleTest.registerCleanupFunction(function() {
+    getTestPlugin("Test Plug-in").enabledState = oldEnabledState;
+  });
+})();
--- a/layout/base/tests/test_bug629838.html
+++ b/layout/base/tests/test_bug629838.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Tests for MozAfterPaint</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="enableTestPlugin.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <p id="display">
 <embed type="application/x-test" width="100" height="100" id="p"
        drawmode="solid" color="FF00FF00"></embed>
 </p>
 <div id="content" style="display: none">
--- a/layout/base/tests/test_mozPaintCount.html
+++ b/layout/base/tests/test_mozPaintCount.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Tests for mozPaintCount</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="enableTestPlugin.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="doBackgroundFlicker()">
 <p id="display">
 <embed type="application/x-test" width="100" height="100" id="p"
        drawmode="solid" color="FF00FF00"></embed>
 </p>
 <div id="content" style="display: none">
--- a/layout/generic/test/Makefile.in
+++ b/layout/generic/test/Makefile.in
@@ -101,16 +101,17 @@ MOCHITEST_FILES = \
   test_bug719523.html \
   test_bug735641.html \
   test_bug748961.html \
   test_bug784410.html \
   test_bug785324.html \
   test_bug791616.html \
   test_bug831780.html \
   test_bug841361.html \
+  $(srcdir)/../../base/tests/enableTestPlugin.js \
   $(NULL)
 
 # Disable the caret movement by word test on Linux because the shortcut keys
 # are defined in system level.  So, it depends on the environment.
 ifndef MOZ_WIDGET_GTK
 MOCHITEST_FILES += \
   test_movement_by_words.html \
   $(NULL)
--- a/layout/generic/test/test_invalidate_during_plugin_paint.html
+++ b/layout/generic/test/test_invalidate_during_plugin_paint.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test handling plugins invalidating during paint</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>    
+  <script type="text/javascript" src="enableTestPlugin.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <style>
   embed { width:200px; height:200px; display:block; }
   </style>
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: block">
--- a/layout/generic/test/test_plugin_focus.html
+++ b/layout/generic/test/test_plugin_focus.html
@@ -1,11 +1,12 @@
 <html title="Test plugin focus control">
 <head>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="enableTestPlugin.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 
 <script class="testbody" type="application/javascript">
 
 var child;
 function childDone() {
--- a/layout/generic/test/test_plugin_mouse_coords.html
+++ b/layout/generic/test/test_plugin_mouse_coords.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test delivering mouse events to plugins</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>    
   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="text/javascript" src="enableTestPlugin.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <style>
   embed { width:200px; height:200px; display:block; }
   iframe { border:none; }
   </style>
 </head>
 <body>
 <p id="display"></p>