OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 scoped_ptr<ExtensionTestMessageListener> done_listener( | 208 scoped_ptr<ExtensionTestMessageListener> done_listener( |
209 new ExtensionTestMessageListener("TEST_PASSED", false)); | 209 new ExtensionTestMessageListener("TEST_PASSED", false)); |
210 done_listener->set_failure_message("TEST_FAILED"); | 210 done_listener->set_failure_message("TEST_FAILED"); |
211 if (!content::ExecuteScript( | 211 if (!content::ExecuteScript( |
212 *embedder_web_contents, | 212 *embedder_web_contents, |
213 base::StringPrintf("runTest('%s')", test_name.c_str()))) { | 213 base::StringPrintf("runTest('%s')", test_name.c_str()))) { |
214 LOG(ERROR) << "UNABLE TO START TEST"; | 214 LOG(ERROR) << "UNABLE TO START TEST"; |
215 return scoped_ptr<ExtensionTestMessageListener>(); | 215 return scoped_ptr<ExtensionTestMessageListener>(); |
216 } | 216 } |
217 | 217 |
218 return done_listener.Pass(); | 218 return done_listener; |
219 } | 219 } |
220 | 220 |
221 void TestHelper(const std::string& test_name, | 221 void TestHelper(const std::string& test_name, |
222 const std::string& app_location, | 222 const std::string& app_location, |
223 TestServer test_server) { | 223 TestServer test_server) { |
224 content::WebContents* embedder_web_contents = NULL; | 224 content::WebContents* embedder_web_contents = NULL; |
225 scoped_ptr<ExtensionTestMessageListener> done_listener( | 225 scoped_ptr<ExtensionTestMessageListener> done_listener( |
226 RunAppHelper( | 226 RunAppHelper( |
227 test_name, app_location, test_server, &embedder_web_contents)); | 227 test_name, app_location, test_server, &embedder_web_contents)); |
228 | 228 |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 // this time. | 1280 // this time. |
1281 for (size_t i = 0; i < 4; ++i) | 1281 for (size_t i = 0; i < 4; ++i) |
1282 SendKeyPressToPlatformApp(ui::VKEY_TAB); | 1282 SendKeyPressToPlatformApp(ui::VKEY_TAB); |
1283 ExtensionTestMessageListener webview_button_not_focused_listener( | 1283 ExtensionTestMessageListener webview_button_not_focused_listener( |
1284 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); | 1284 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); |
1285 webview_button_not_focused_listener.set_failure_message( | 1285 webview_button_not_focused_listener.set_failure_message( |
1286 "WebViewInteractiveTest.WebViewButtonWasFocused"); | 1286 "WebViewInteractiveTest.WebViewButtonWasFocused"); |
1287 SendMessageToEmbedder("verify"); | 1287 SendMessageToEmbedder("verify"); |
1288 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied()); | 1288 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied()); |
1289 } | 1289 } |
OLD | NEW |