summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/execute_script_apitest.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-24 13:17:19 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-24 13:17:19 +0000
commit4712e8528ddbdffe188aeeb84d57c4a1c7660eda (patch)
tree539cef205a3adfcd963f59a6c80ff1b537685b8f /chrome/browser/extensions/execute_script_apitest.cc
parent0afe68413da01db71195735242bd26dae90bb25b (diff)
downloadchromium_src-4712e8528ddbdffe188aeeb84d57c4a1c7660eda.zip
chromium_src-4712e8528ddbdffe188aeeb84d57c4a1c7660eda.tar.gz
chromium_src-4712e8528ddbdffe188aeeb84d57c4a1c7660eda.tar.bz2
Split up and enable ExecuteScriptApiTest.
I ran these tests locally and saw DCHECKs, which are due to the PropSet problem discussed on chromium-dev recently. These were taken care of by sync'ing to latest since sky has just converted to ScopedProp and flushed some issues out. I did also notice that on my beefy machine that running just *one* of those extensions tests took about 10 seconds, so lumping in three of those into one test must be very likely to cause timeouts. I have therefore split them up into individual tests. I can't get it to fail on my machine, so I think it is time to try it out on the bots. BUG=28630 TEST=This CL is about fixing tests. Review URL: http://codereview.chromium.org/5285002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/execute_script_apitest.cc')
-rw-r--r--chrome/browser/extensions/execute_script_apitest.cc35
1 files changed, 23 insertions, 12 deletions
diff --git a/chrome/browser/extensions/execute_script_apitest.cc b/chrome/browser/extensions/execute_script_apitest.cc
index 9edd0b6..0015de9 100644
--- a/chrome/browser/extensions/execute_script_apitest.cc
+++ b/chrome/browser/extensions/execute_script_apitest.cc
@@ -5,25 +5,36 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "net/base/mock_host_resolver.h"
-// EXTREMELY flaky, crashy, and bad. See http://crbug.com/28630 and don't dare
-// to re-enable without a real fix or at least adding more debugging info.
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_ExecuteScript) {
- // We need a.com to be a little bit slow to trigger a race condition.
- host_resolver()->AddRuleWithLatency("a.com", "127.0.0.1", 500);
- host_resolver()->AddRule("b.com", "127.0.0.1");
- host_resolver()->AddRule("c.com", "127.0.0.1");
- ASSERT_TRUE(StartTestServer());
+class ExecuteScriptApiTest : public ExtensionApiTest {
+ protected:
+ void SetupDelayedHostResolver() {
+ // We need a.com to be a little bit slow to trigger a race condition.
+ host_resolver()->AddRuleWithLatency("a.com", "127.0.0.1", 500);
+ host_resolver()->AddRule("b.com", "127.0.0.1");
+ host_resolver()->AddRule("c.com", "127.0.0.1");
+ }
+};
+IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptBasic) {
+ SetupDelayedHostResolver();
+ ASSERT_TRUE(StartTestServer());
ASSERT_TRUE(RunExtensionTest("executescript/basic")) << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptInFrame) {
+ SetupDelayedHostResolver();
+ ASSERT_TRUE(StartTestServer());
ASSERT_TRUE(RunExtensionTest("executescript/in_frame")) << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptPermissions) {
+ SetupDelayedHostResolver();
+ ASSERT_TRUE(StartTestServer());
ASSERT_TRUE(RunExtensionTest("executescript/permissions")) << message_;
}
-// TODO(rafaelw) - This case is split out per Pawel's request. When the above
-// (ExecuteScript) tests are de-flakified, reunite this case with it's brethern.
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ExecuteScriptFileAfterClose) {
+IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptFileAfterClose) {
host_resolver()->AddRule("b.com", "127.0.0.1");
ASSERT_TRUE(StartTestServer());
-
ASSERT_TRUE(RunExtensionTest("executescript/file_after_close")) << message_;
}