| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dns/mock_host_resolver.h" | 6 #include "net/dns/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 18 matching lines...) Expand all Loading... |
| 29 ASSERT_TRUE(RunExtensionTest("../bad")) << message_; | 29 ASSERT_TRUE(RunExtensionTest("../bad")) << message_; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // If failing, mark disabled and update http://crbug.com/92105. | 32 // If failing, mark disabled and update http://crbug.com/92105. |
| 33 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptInFrame) { | 33 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptInFrame) { |
| 34 SetupDelayedHostResolver(); | 34 SetupDelayedHostResolver(); |
| 35 ASSERT_TRUE(StartEmbeddedTestServer()); | 35 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 36 ASSERT_TRUE(RunExtensionTest("executescript/in_frame")) << message_; | 36 ASSERT_TRUE(RunExtensionTest("executescript/in_frame")) << message_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, ExecuteScriptByFrameId) { |
| 40 SetupDelayedHostResolver(); |
| 41 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 42 ASSERT_TRUE(RunExtensionTest("executescript/frame_id")) << message_; |
| 43 } |
| 44 |
| 39 // Fails often on Windows. | 45 // Fails often on Windows. |
| 40 // http://crbug.com/174715 | 46 // http://crbug.com/174715 |
| 41 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 42 #define MAYBE_ExecuteScriptPermissions DISABLED_ExecuteScriptPermissions | 48 #define MAYBE_ExecuteScriptPermissions DISABLED_ExecuteScriptPermissions |
| 43 #else | 49 #else |
| 44 #define MAYBE_ExecuteScriptPermissions ExecuteScriptPermissions | 50 #define MAYBE_ExecuteScriptPermissions ExecuteScriptPermissions |
| 45 #endif // defined(OS_WIN) | 51 #endif // defined(OS_WIN) |
| 46 | 52 |
| 47 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, MAYBE_ExecuteScriptPermissions) { | 53 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, MAYBE_ExecuteScriptPermissions) { |
| 48 SetupDelayedHostResolver(); | 54 SetupDelayedHostResolver(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 SetupDelayedHostResolver(); | 110 SetupDelayedHostResolver(); |
| 105 ASSERT_TRUE(StartEmbeddedTestServer()); | 111 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 106 ASSERT_TRUE(RunExtensionTest("executescript/callback")) << message_; | 112 ASSERT_TRUE(RunExtensionTest("executescript/callback")) << message_; |
| 107 } | 113 } |
| 108 | 114 |
| 109 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, UserGesture) { | 115 IN_PROC_BROWSER_TEST_F(ExecuteScriptApiTest, UserGesture) { |
| 110 SetupDelayedHostResolver(); | 116 SetupDelayedHostResolver(); |
| 111 ASSERT_TRUE(StartEmbeddedTestServer()); | 117 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 112 ASSERT_TRUE(RunExtensionTest("executescript/user_gesture")) << message_; | 118 ASSERT_TRUE(RunExtensionTest("executescript/user_gesture")) << message_; |
| 113 } | 119 } |
| OLD | NEW |