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/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 void SimpleTest(const GURL& test_url, bool incognito = false) { | 48 void SimpleTest(const GURL& test_url, bool incognito = false) { |
49 // The test page will perform tests on IndexedDB, then navigate to either | 49 // The test page will perform tests on IndexedDB, then navigate to either |
50 // a #pass or #fail ref. | 50 // a #pass or #fail ref. |
51 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); | 51 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); |
52 | 52 |
53 LOG(INFO) << "Navigating to URL and blocking."; | 53 LOG(INFO) << "Navigating to URL and blocking."; |
54 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 54 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
55 the_browser, test_url, 2); | 55 the_browser, test_url, 2); |
56 LOG(INFO) << "Navigation done."; | 56 LOG(INFO) << "Navigation done."; |
57 std::string result = the_browser->GetSelectedWebContents()->GetURL().ref(); | 57 std::string result = the_browser->GetActiveWebContents()->GetURL().ref(); |
58 if (result != "pass") { | 58 if (result != "pass") { |
59 std::string js_result; | 59 std::string js_result; |
60 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( | 60 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( |
61 the_browser->GetSelectedWebContents()->GetRenderViewHost(), L"", | 61 the_browser->GetActiveWebContents()->GetRenderViewHost(), L"", |
62 L"window.domAutomationController.send(getLog())", &js_result)); | 62 L"window.domAutomationController.send(getLog())", &js_result)); |
63 FAIL() << "Failed: " << js_result; | 63 FAIL() << "Failed: " << js_result; |
64 } | 64 } |
65 } | 65 } |
66 }; | 66 }; |
67 | 67 |
68 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { | 68 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { |
69 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); | 69 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); |
70 } | 70 } |
71 | 71 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 // Appears flaky/slow, see: http://crbug.com/120298 | 110 // Appears flaky/slow, see: http://crbug.com/120298 |
111 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_ValueSizeTest) { | 111 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_ValueSizeTest) { |
112 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("value_size_test.html")))); | 112 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("value_size_test.html")))); |
113 } | 113 } |
114 | 114 |
115 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DoesntHangTest) { | 115 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DoesntHangTest) { |
116 SimpleTest(GetTestURL(FilePath( | 116 SimpleTest(GetTestURL(FilePath( |
117 FILE_PATH_LITERAL("transaction_run_forever.html")))); | 117 FILE_PATH_LITERAL("transaction_run_forever.html")))); |
118 ui_test_utils::CrashTab(browser()->GetSelectedWebContents()); | 118 ui_test_utils::CrashTab(browser()->GetActiveWebContents()); |
119 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); | 119 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); |
120 } | 120 } |
121 | 121 |
122 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug84933Test) { | 122 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, Bug84933Test) { |
123 const GURL url = GetTestURL(FilePath(FILE_PATH_LITERAL("bug_84933.html"))); | 123 const GURL url = GetTestURL(FilePath(FILE_PATH_LITERAL("bug_84933.html"))); |
124 | 124 |
125 // Just navigate to the URL. Test will crash if it fails. | 125 // Just navigate to the URL. Test will crash if it fails. |
126 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); | 126 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 1); |
127 } | 127 } |
128 | 128 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 virtual void SetUpCommandLine(CommandLine* command_line) { | 179 virtual void SetUpCommandLine(CommandLine* command_line) { |
180 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | 180 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); |
181 } | 181 } |
182 }; | 182 }; |
183 | 183 |
184 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, | 184 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, |
185 DatabaseCallbacksTest) { | 185 DatabaseCallbacksTest) { |
186 SimpleTest( | 186 SimpleTest( |
187 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); | 187 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); |
188 } | 188 } |
OLD | NEW |