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(), L"", | 53 the_browser->web_contents()->GetRenderViewHost(), |
54 L"window.domAutomationController.send(getLog())", &js_result)); | 54 std::string(), |
| 55 "window.domAutomationController.send(getLog())", |
| 56 &js_result)); |
55 FAIL() << "Failed: " << js_result; | 57 FAIL() << "Failed: " << js_result; |
56 } | 58 } |
57 } | 59 } |
58 | 60 |
59 void NavigateAndWaitForTitle(Shell* shell, | 61 void NavigateAndWaitForTitle(Shell* shell, |
60 const char* filename, | 62 const char* filename, |
61 const char* hash, | 63 const char* hash, |
62 const char* expected_string) { | 64 const char* expected_string) { |
63 GURL url = GetTestUrl("indexeddb", filename); | 65 GURL url = GetTestUrl("indexeddb", filename); |
64 if (hash) | 66 if (hash) |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); | 388 TitleWatcher title_watcher(new_shell->web_contents(), expected_title16); |
387 | 389 |
388 base::KillProcess( | 390 base::KillProcess( |
389 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); | 391 shell()->web_contents()->GetRenderProcessHost()->GetHandle(), 0, true); |
390 shell()->Close(); | 392 shell()->Close(); |
391 | 393 |
392 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 394 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
393 } | 395 } |
394 | 396 |
395 } // namespace content | 397 } // namespace content |
OLD | NEW |