OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/common/chrome_switches.h" | |
12 #include "chrome/test/in_process_browser_test.h" | 13 #include "chrome/test/in_process_browser_test.h" |
13 #include "chrome/test/testing_profile.h" | 14 #include "chrome/test/testing_profile.h" |
14 #include "chrome/test/thread_test_helper.h" | 15 #include "chrome/test/thread_test_helper.h" |
15 #include "chrome/test/ui_test_utils.h" | 16 #include "chrome/test/ui_test_utils.h" |
16 #include "content/browser/in_process_webkit/indexed_db_context.h" | 17 #include "content/browser/in_process_webkit/indexed_db_context.h" |
17 #include "content/browser/in_process_webkit/webkit_context.h" | 18 #include "content/browser/in_process_webkit/webkit_context.h" |
18 #include "content/browser/tab_contents/tab_contents.h" | 19 #include "content/browser/tab_contents/tab_contents.h" |
19 | 20 |
20 // This browser test is aimed towards exercising the IndexedDB bindings and | 21 // This browser test is aimed towards exercising the IndexedDB bindings and |
21 // the actual implementation that lives in the browser side (in_process_webkit). | 22 // the actual implementation that lives in the browser side (in_process_webkit). |
(...skipping 17 matching lines...) Expand all Loading... | |
39 LOG(INFO) << "Navigation done."; | 40 LOG(INFO) << "Navigation done."; |
40 std::string result = browser()->GetSelectedTabContents()->GetURL().ref(); | 41 std::string result = browser()->GetSelectedTabContents()->GetURL().ref(); |
41 if (result != "pass") { | 42 if (result != "pass") { |
42 std::string js_result; | 43 std::string js_result; |
43 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( | 44 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( |
44 browser()->GetSelectedTabContents()->render_view_host(), L"", | 45 browser()->GetSelectedTabContents()->render_view_host(), L"", |
45 L"window.domAutomationController.send(getLog())", &js_result)); | 46 L"window.domAutomationController.send(getLog())", &js_result)); |
46 FAIL() << "Failed: " << js_result; | 47 FAIL() << "Failed: " << js_result; |
47 } | 48 } |
48 } | 49 } |
50 virtual void SetUpCommandLine(CommandLine* command_line) { | |
51 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); | |
jorlow
2011/03/15 02:30:04
Let's only do this on tests we have to. I've seen
dgrogan
2011/03/15 03:32:27
Sounds good. Is it easy to add this per test in t
jorlow
2011/03/15 03:35:37
I believe you just need another text fixture that
Paweł Hajdan Jr.
2011/03/15 19:49:11
Can we create a constant for --expose-gc?
jorlow
2011/03/15 20:25:46
The only reason to bother making a constant is if
dgrogan
2011/03/16 22:00:12
Done.
| |
52 } | |
49 }; | 53 }; |
50 | 54 |
51 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { | 55 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { |
52 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); | 56 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); |
53 } | 57 } |
54 | 58 |
55 // Flaky: http://crbug.com/70773 | 59 // Flaky: http://crbug.com/70773 |
56 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_IndexTest) { | 60 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_IndexTest) { |
57 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("index_test.html")))); | 61 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("index_test.html")))); |
58 } | 62 } |
(...skipping 14 matching lines...) Expand all Loading... | |
73 | 77 |
74 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DatabaseTest) { | 78 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DatabaseTest) { |
75 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("database_test.html")))); | 79 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("database_test.html")))); |
76 } | 80 } |
77 | 81 |
78 // Flaky: http://crbug.com/70773 | 82 // Flaky: http://crbug.com/70773 |
79 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionTest) { | 83 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_TransactionTest) { |
80 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); | 84 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); |
81 } | 85 } |
82 | 86 |
87 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DatabaseCallbacksTest) { | |
88 SimpleTest( | |
89 testUrl(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); | |
90 } | |
91 | |
83 // Flaky: http://crbug.com/70773 | 92 // Flaky: http://crbug.com/70773 |
84 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { | 93 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_DoesntHangTest) { |
85 SimpleTest(testUrl(FilePath( | 94 SimpleTest(testUrl(FilePath( |
86 FILE_PATH_LITERAL("transaction_run_forever.html")))); | 95 FILE_PATH_LITERAL("transaction_run_forever.html")))); |
87 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); | 96 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); |
88 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); | 97 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("transaction_test.html")))); |
89 } | 98 } |
90 | 99 |
91 // In proc browser test is needed here because ClearLocalState indirectly calls | 100 // In proc browser test is needed here because ClearLocalState indirectly calls |
92 // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. | 101 // WebKit's isMainThread through WebSecurityOrigin->SecurityOrigin. |
(...skipping 26 matching lines...) Expand all Loading... | |
119 // Make sure we wait until the destructor has run. | 128 // Make sure we wait until the destructor has run. |
120 scoped_refptr<ThreadTestHelper> helper( | 129 scoped_refptr<ThreadTestHelper> helper( |
121 new ThreadTestHelper(BrowserThread::WEBKIT)); | 130 new ThreadTestHelper(BrowserThread::WEBKIT)); |
122 ASSERT_TRUE(helper->Run()); | 131 ASSERT_TRUE(helper->Run()); |
123 | 132 |
124 // Because we specified https for scheme to be skipped the second file | 133 // Because we specified https for scheme to be skipped the second file |
125 // should survive and the first go into vanity. | 134 // should survive and the first go into vanity. |
126 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); | 135 ASSERT_FALSE(file_util::PathExists(temp_file_path_1)); |
127 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); | 136 ASSERT_TRUE(file_util::PathExists(temp_file_path_2)); |
128 } | 137 } |
OLD | NEW |