OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 void SimpleTest(const GURL& test_url, bool incognito = false) { | 43 void SimpleTest(const GURL& test_url, bool incognito = false) { |
44 // The test page will perform tests on IndexedDB, then navigate to either | 44 // The test page will perform tests on IndexedDB, then navigate to either |
45 // a #pass or #fail ref. | 45 // a #pass or #fail ref. |
46 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); | 46 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); |
47 | 47 |
48 LOG(INFO) << "Navigating to URL and blocking."; | 48 LOG(INFO) << "Navigating to URL and blocking."; |
49 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 49 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
50 the_browser, test_url, 2); | 50 the_browser, test_url, 2); |
51 LOG(INFO) << "Navigation done."; | 51 LOG(INFO) << "Navigation done."; |
52 std::string result = the_browser->GetSelectedTabContents()->GetURL().ref(); | 52 std::string result = the_browser->GetSelectedWebContents()->GetURL().ref(); |
53 if (result != "pass") { | 53 if (result != "pass") { |
54 std::string js_result; | 54 std::string js_result; |
55 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( | 55 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( |
56 the_browser->GetSelectedTabContents()->GetRenderViewHost(), L"", | 56 the_browser->GetSelectedWebContents()->GetRenderViewHost(), L"", |
57 L"window.domAutomationController.send(getLog())", &js_result)); | 57 L"window.domAutomationController.send(getLog())", &js_result)); |
58 FAIL() << "Failed: " << js_result; | 58 FAIL() << "Failed: " << js_result; |
59 } | 59 } |
60 } | 60 } |
61 }; | 61 }; |
62 | 62 |
63 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { | 63 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { |
64 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); | 64 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); |
65 } | 65 } |
66 | 66 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // Flaky: http://crbug.com/70773 | 107 // Flaky: http://crbug.com/70773 |
108 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionTest) { | 108 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionTest) { |
109 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); | 109 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); |
110 } | 110 } |
111 | 111 |
112 // Flaky: http://crbug.com/70773 | 112 // Flaky: http://crbug.com/70773 |
113 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { | 113 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { |
114 SimpleTest(testUrl(FilePath( | 114 SimpleTest(testUrl(FilePath( |
115 FILE_PATH_LITERAL("transaction_run_forever.html")))); | 115 FILE_PATH_LITERAL("transaction_run_forever.html")))); |
116 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); | 116 ui_test_utils::CrashTab(browser()->GetSelectedWebContents()); |
117 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); | 117 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); |
118 } | 118 } |
119 | 119 |
120 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug84933Test) { | 120 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug84933Test) { |
121 const GURL url = testUrl(FilePath(FILE_PATH_LITERAL("bug_84933.html"))); | 121 const GURL url = testUrl(FilePath(FILE_PATH_LITERAL("bug_84933.html"))); |
122 | 122 |
123 // Just navigate to the URL. Test will crash if it fails. | 123 // Just navigate to the URL. Test will crash if it fails. |
124 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); | 124 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); |
125 } | 125 } |
126 | 126 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 virtual void SetUpCommandLine(CommandLine* command_line) { | 316 virtual void SetUpCommandLine(CommandLine* command_line) { |
317 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 317 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
318 } | 318 } |
319 }; | 319 }; |
320 | 320 |
321 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, | 321 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, |
322 DatabaseCallbacksTest) { | 322 DatabaseCallbacksTest) { |
323 SimpleTest( | 323 SimpleTest( |
324 testUrl(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); | 324 testUrl(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); |
325 } | 325 } |
OLD | NEW |