| 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_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // the actual implementation that lives in the browser side. | 36 // the actual implementation that lives in the browser side. |
| 37 class IndexedDBBrowserTest : public ContentBrowserTest { | 37 class IndexedDBBrowserTest : public ContentBrowserTest { |
| 38 public: | 38 public: |
| 39 IndexedDBBrowserTest() : disk_usage_(-1) {} | 39 IndexedDBBrowserTest() : disk_usage_(-1) {} |
| 40 | 40 |
| 41 void SimpleTest(const GURL& test_url, bool incognito = false) { | 41 void SimpleTest(const GURL& test_url, bool incognito = false) { |
| 42 // The test page will perform tests on IndexedDB, then navigate to either | 42 // The test page will perform tests on IndexedDB, then navigate to either |
| 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 VLOG(0) << "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 VLOG(0) << "Navigation done."; |
| 49 std::string result = | 49 std::string result = |
| 50 the_browser->web_contents()->GetLastCommittedURL().ref(); | 50 the_browser->web_contents()->GetLastCommittedURL().ref(); |
| 51 if (result != "pass") { | 51 if (result != "pass") { |
| 52 std::string js_result; | 52 std::string js_result; |
| 53 ASSERT_TRUE(ExecuteScriptAndExtractString( | 53 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 54 the_browser->web_contents(), | 54 the_browser->web_contents(), |
| 55 "window.domAutomationController.send(getLog())", | 55 "window.domAutomationController.send(getLog())", |
| 56 &js_result)); | 56 &js_result)); |
| 57 FAIL() << "Failed: " << js_result; | 57 FAIL() << "Failed: " << js_result; |
| 58 } | 58 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 command_line->AppendSwitch(switches::kSingleProcess); | 432 command_line->AppendSwitch(switches::kSingleProcess); |
| 433 } | 433 } |
| 434 }; | 434 }; |
| 435 | 435 |
| 436 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 436 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
| 437 RenderThreadShutdownTest) { | 437 RenderThreadShutdownTest) { |
| 438 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 438 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
| 439 } | 439 } |
| 440 | 440 |
| 441 } // namespace content | 441 } // namespace content |
| OLD | NEW |