| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // a #pass or #fail ref. | 43 // a #pass or #fail ref. |
| 44 Shell* the_browser = incognito ? CreateOffTheRecordBrowser() : shell(); | 44 Shell* the_browser = incognito ? CreateOffTheRecordBrowser() : shell(); |
| 45 | 45 |
| 46 LOG(INFO) << "Navigating to URL and blocking."; | 46 LOG(INFO) << "Navigating to URL and blocking."; |
| 47 NavigateToURLBlockUntilNavigationsComplete(the_browser, test_url, 2); | 47 NavigateToURLBlockUntilNavigationsComplete(the_browser, test_url, 2); |
| 48 LOG(INFO) << "Navigation done."; | 48 LOG(INFO) << "Navigation done."; |
| 49 std::string result = the_browser->web_contents()->GetURL().ref(); | 49 std::string result = the_browser->web_contents()->GetURL().ref(); |
| 50 if (result != "pass") { | 50 if (result != "pass") { |
| 51 std::string js_result; | 51 std::string js_result; |
| 52 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( | 52 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( |
| 53 the_browser->web_contents()->GetRenderViewHost(), | 53 the_browser->web_contents()->GetRenderViewHost(), L"", |
| 54 std::string(), | 54 L"window.domAutomationController.send(getLog())", &js_result)); |
| 55 "window.domAutomationController.send(getLog())", | |
| 56 &js_result)); | |
| 57 FAIL() << "Failed: " << js_result; | 55 FAIL() << "Failed: " << js_result; |
| 58 } | 56 } |
| 59 } | 57 } |
| 60 | 58 |
| 61 void NavigateAndWaitForTitle(Shell* shell, | 59 void NavigateAndWaitForTitle(Shell* shell, |
| 62 const char* filename, | 60 const char* filename, |
| 63 const char* hash, | 61 const char* hash, |
| 64 const char* expected_string) { | 62 const char* expected_string) { |
| 65 GURL url = GetTestUrl("indexeddb", filename); | 63 GURL url = GetTestUrl("indexeddb", filename); |
| 66 if (hash) | 64 if (hash) |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); | 386 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); |
| 389 | 387 |
| 390 base::KillProcess( | 388 base::KillProcess( |
| 391 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); | 389 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); |
| 392 shell()->Close(); | 390 shell()->Close(); |
| 393 | 391 |
| 394 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 392 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
| 395 } | 393 } |
| 396 | 394 |
| 397 } // namespace content | 395 } // namespace content |
| OLD | NEW |