| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "net/base/mock_host_resolver.h" | 6 #include "net/base/mock_host_resolver.h" |
| 7 | 7 |
| 8 class ExecuteScriptApiTest : public ExtensionApiTest { | 8 class ExecuteScriptApiTest : public ExtensionApiTest { |
| 9 protected: | 9 protected: |
| 10 void SetupDelayedHostResolver() { | 10 void SetupDelayedHostResolver() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Crashy, http://crbug.com/67774. | 50 // Crashy, http://crbug.com/67774. |
| 51 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, | 51 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, |
| 52 DISABLED_ExecuteScriptFragmentNavigation) { | 52 DISABLED_ExecuteScriptFragmentNavigation) { |
| 53 ASSERT_TRUE(StartTestServer()); | 53 ASSERT_TRUE(StartTestServer()); |
| 54 const char* extension_name = "executescript/fragment"; | 54 const char* extension_name = "executescript/fragment"; |
| 55 ASSERT_TRUE(RunExtensionTest(extension_name)) << message_; | 55 ASSERT_TRUE(RunExtensionTest(extension_name)) << message_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 #if defined(OS_LINUX) || defined(OS_MACOSX) | 58 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, NavigationRaceExecuteScript) { |
| 59 // Flakily times out: http://crbug.com/78802 | |
| 60 #define MAYBE_NavigationRace DISABLED_NavigationRace | |
| 61 #else | |
| 62 #define MAYBE_NavigationRace NavigationRace | |
| 63 #endif | |
| 64 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, MAYBE_NavigationRace) { | |
| 65 host_resolver()->AddRule("a.com", "127.0.0.1"); | 59 host_resolver()->AddRule("a.com", "127.0.0.1"); |
| 66 host_resolver()->AddRule("b.com", "127.0.0.1"); | 60 host_resolver()->AddRule("b.com", "127.0.0.1"); |
| 67 ASSERT_TRUE(StartTestServer()); | 61 ASSERT_TRUE(StartTestServer()); |
| 68 ASSERT_TRUE(RunExtensionSubtest("executescript/navigation_race", | 62 ASSERT_TRUE(RunExtensionSubtest("executescript/navigation_race", |
| 69 "execute_script.html")) << message_; | 63 "execute_script.html")) << message_; |
| 64 } |
| 65 |
| 66 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, NavigationRaceJavaScriptUrl) { |
| 67 host_resolver()->AddRule("a.com", "127.0.0.1"); |
| 68 host_resolver()->AddRule("b.com", "127.0.0.1"); |
| 69 ASSERT_TRUE(StartTestServer()); |
| 70 ASSERT_TRUE(RunExtensionSubtest("executescript/navigation_race", | 70 ASSERT_TRUE(RunExtensionSubtest("executescript/navigation_race", |
| 71 "javascript_url.html")) << message_; | 71 "javascript_url.html")) << message_; |
| 72 } | 72 } |
| 73 | 73 |
| 74 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptFrameAfterLoad) { | 74 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptFrameAfterLoad) { |
| 75 SetupDelayedHostResolver(); | 75 SetupDelayedHostResolver(); |
| 76 ASSERT_TRUE(StartTestServer()); | 76 ASSERT_TRUE(StartTestServer()); |
| 77 ASSERT_TRUE(RunExtensionTest("executescript/frame_after_load")) << message_; | 77 ASSERT_TRUE(RunExtensionTest("executescript/frame_after_load")) << message_; |
| 78 } | 78 } |
| OLD | NEW |