OLD | NEW |
1 // Copyright (c) 2009 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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/test/test_timeouts.h" |
7 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
8 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
9 #include "chrome/test/ui/ui_layout_test.h" | 10 #include "chrome/test/ui/ui_layout_test.h" |
10 #include "chrome/test/ui_test_utils.h" | 11 #include "chrome/test/ui_test_utils.h" |
11 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
12 | 13 |
13 static const char* kRootFiles[] = { | 14 static const char* kRootFiles[] = { |
14 "clear.html", | 15 "clear.html", |
15 // "complex-keys.html", // Output too big for a cookie. crbug.com/33472 | 16 // "complex-keys.html", // Output too big for a cookie. crbug.com/33472 |
16 // "complex-values.html", // crbug.com/33472 | 17 // "complex-values.html", // crbug.com/33472 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void ClearDOMStorage() { | 72 void ClearDOMStorage() { |
72 scoped_refptr<TabProxy> tab(GetActiveTab()); | 73 scoped_refptr<TabProxy> tab(GetActiveTab()); |
73 ASSERT_TRUE(tab.get()); | 74 ASSERT_TRUE(tab.get()); |
74 | 75 |
75 const FilePath dir(FILE_PATH_LITERAL("layout_tests")); | 76 const FilePath dir(FILE_PATH_LITERAL("layout_tests")); |
76 const FilePath file(FILE_PATH_LITERAL("clear_dom_storage.html")); | 77 const FilePath file(FILE_PATH_LITERAL("clear_dom_storage.html")); |
77 GURL url = ui_test_utils::GetTestUrl(dir, file); | 78 GURL url = ui_test_utils::GetTestUrl(dir, file); |
78 ASSERT_TRUE(tab->SetCookie(url, "")); | 79 ASSERT_TRUE(tab->SetCookie(url, "")); |
79 ASSERT_TRUE(tab->NavigateToURL(url)); | 80 ASSERT_TRUE(tab->NavigateToURL(url)); |
80 | 81 |
81 WaitUntilCookieNonEmpty(tab.get(), url, "cleared", action_max_timeout_ms()); | 82 WaitUntilCookieNonEmpty(tab.get(), url, "cleared", |
| 83 TestTimeouts::action_max_timeout_ms()); |
82 } | 84 } |
83 | 85 |
84 // Runs each test in an array of strings until it hits a NULL. | 86 // Runs each test in an array of strings until it hits a NULL. |
85 void RunTests(const char** files) { | 87 void RunTests(const char** files) { |
86 while (*files) { | 88 while (*files) { |
87 ClearDOMStorage(); | 89 ClearDOMStorage(); |
88 RunLayoutTest(*files, kNoHttpPort); | 90 RunLayoutTest(*files, kNoHttpPort); |
89 ++files; | 91 ++files; |
90 } | 92 } |
91 } | 93 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 NavigateToURL(GURL("javascript:set()")); | 181 NavigateToURL(GURL("javascript:set()")); |
180 QuitBrowser(); | 182 QuitBrowser(); |
181 EXPECT_FALSE(StorageDirIsEmpty()); | 183 EXPECT_FALSE(StorageDirIsEmpty()); |
182 | 184 |
183 LaunchBrowserAndServer(); | 185 LaunchBrowserAndServer(); |
184 NavigateToURL(TestUrl()); | 186 NavigateToURL(TestUrl()); |
185 NavigateToURL(GURL("javascript:clear()")); | 187 NavigateToURL(GURL("javascript:clear()")); |
186 QuitBrowser(); | 188 QuitBrowser(); |
187 EXPECT_TRUE(StorageDirIsEmpty()); | 189 EXPECT_TRUE(StorageDirIsEmpty()); |
188 } | 190 } |
OLD | NEW |