Index: chrome/browser/collected_cookies_browsertest.cc |
=================================================================== |
--- chrome/browser/collected_cookies_browsertest.cc (revision 137005) |
+++ chrome/browser/collected_cookies_browsertest.cc (working copy) |
@@ -5,12 +5,13 @@ |
#include <string> |
#include "chrome/app/chrome_command_ids.h" |
+#include "chrome/browser/content_settings/cookie_settings.h" |
#include "chrome/browser/net/url_fixer_upper.h" |
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/common/url_constants.h" |
-#include "chrome/test/automation/automation_proxy.h" |
-#include "chrome/test/automation/browser_proxy.h" |
-#include "chrome/test/automation/tab_proxy.h" |
-#include "chrome/test/ui/ui_test.h" |
+#include "chrome/test/base/in_process_browser_test.h" |
+#include "chrome/test/base/ui_test_utils.h" |
#include "net/test/test_server.h" |
namespace { |
@@ -19,66 +20,42 @@ |
} // namespace |
-typedef UITest CollectedCookiesTest; |
+typedef InProcessBrowserTest CollectedCookiesTest; |
-// Crashing on Windows, see http://crbug.com/79331 |
-#if defined(OS_WIN) |
-#define MAYBE_DoubleDisplay DISABLED_DoubleDisplay |
-#else |
-#define MAYBE_DoubleDisplay DoubleDisplay |
-#endif |
-TEST_F(CollectedCookiesTest, MAYBE_DoubleDisplay) { |
- net::TestServer test_server(net::TestServer::TYPE_HTTP, |
- net::TestServer::kLocalhost, |
- FilePath(kDocRoot)); |
- ASSERT_TRUE(test_server.Start()); |
+// If this crashes on Windows, use http://crbug.com/79331 |
+IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, DoubleDisplay) { |
+ ASSERT_TRUE(test_server()->Start()); |
- scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
- ASSERT_TRUE(browser.get()); |
- |
- scoped_refptr<TabProxy> tab(browser->GetTab(0)); |
- ASSERT_TRUE(tab.get()); |
- |
// Disable cookies. |
- ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
- CONTENT_SETTING_BLOCK)); |
+ CookieSettings::Factory::GetForProfile(browser()->profile())-> |
+ SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
// Load a page with cookies. |
- ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html"))); |
+ ui_test_utils::NavigateToURL( |
+ browser(), test_server()->GetURL("files/cookie1.html")); |
// Click on the info link twice. |
- ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); |
- ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); |
+ TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); |
+ browser()->ShowCollectedCookiesDialog(tab_contents); |
+ browser()->ShowCollectedCookiesDialog(tab_contents); |
} |
-// Crashing on Windows, see http://crbug.com/79331 |
-#if defined(OS_WIN) |
-#define MAYBE_NavigateAway DISABLED_NavigateAway |
-#else |
-#define MAYBE_NavigateAway NavigateAway |
-#endif |
-TEST_F(CollectedCookiesTest, MAYBE_NavigateAway) { |
- net::TestServer test_server(net::TestServer::TYPE_HTTP, |
- net::TestServer::kLocalhost, |
- FilePath(kDocRoot)); |
- ASSERT_TRUE(test_server.Start()); |
+// If this crashes on Windows, use http://crbug.com/79331 |
+IN_PROC_BROWSER_TEST_F(CollectedCookiesTest, NavigateAway) { |
- scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
- ASSERT_TRUE(browser.get()); |
- |
- scoped_refptr<TabProxy> tab(browser->GetTab(0)); |
- ASSERT_TRUE(tab.get()); |
- |
// Disable cookies. |
- ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
- CONTENT_SETTING_BLOCK)); |
+ CookieSettings::Factory::GetForProfile(browser()->profile())-> |
+ SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); |
// Load a page with cookies. |
- ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html"))); |
+ ui_test_utils::NavigateToURL( |
+ browser(), test_server()->GetURL("files/cookie1.html")); |
// Click on the info link. |
- ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); |
+ TabContentsWrapper* tab_contents = browser()->GetSelectedTabContentsWrapper(); |
+ browser()->ShowCollectedCookiesDialog(tab_contents); |
// Navigate to another page. |
- ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie2.html"))); |
+ ui_test_utils::NavigateToURL( |
+ browser(), test_server()->GetURL("files/cookie2.html")); |
} |