Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/collected_cookies_uitest.cc

Issue 3034038: GTTF: Move more test server code from net/url_request/url_request_unittest.h (Closed)
Patch Set: hopefully final Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/browser/net/url_fixer_upper.h" 8 #include "chrome/browser/net/url_fixer_upper.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 #include "chrome/test/automation/tab_proxy.h" 11 #include "chrome/test/automation/tab_proxy.h"
12 #include "chrome/test/automation/browser_proxy.h" 12 #include "chrome/test/automation/browser_proxy.h"
13 #include "chrome/test/ui/ui_test.h" 13 #include "chrome/test/ui/ui_test.h"
14 #include "net/url_request/url_request_unittest.h" 14 #include "net/test/test_server.h"
15 15
16 namespace { 16 namespace {
17 17
18 const wchar_t kDocRoot[] = L"chrome/test/data"; 18 const wchar_t kDocRoot[] = L"chrome/test/data";
19 19
20 } // namespace 20 } // namespace
21 21
22 typedef UITest CollectedCookiesTest; 22 typedef UITest CollectedCookiesTest;
23 23
24 // Test is flaky. http://crbug.com/49539 24 // Test is flaky. http://crbug.com/49539
25 TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) { 25 TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) {
26 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); 26 scoped_refptr<net::HTTPTestServer> server(
27 net::HTTPTestServer::CreateServer(kDocRoot));
27 ASSERT_TRUE(NULL != server.get()); 28 ASSERT_TRUE(NULL != server.get());
28 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 29 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
29 ASSERT_TRUE(browser.get()); 30 ASSERT_TRUE(browser.get());
30 31
31 scoped_refptr<TabProxy> tab(browser->GetTab(0)); 32 scoped_refptr<TabProxy> tab(browser->GetTab(0));
32 ASSERT_TRUE(tab.get()); 33 ASSERT_TRUE(tab.get());
33 34
34 // Disable cookies. 35 // Disable cookies.
35 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 36 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
36 CONTENT_SETTING_BLOCK)); 37 CONTENT_SETTING_BLOCK));
37 38
38 // Load a page with cookies. 39 // Load a page with cookies.
39 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html"))); 40 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html")));
40 41
41 // Click on the info link twice. 42 // Click on the info link twice.
42 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 43 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
43 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 44 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
44 } 45 }
45 46
46 // Test is flaky. http://crbug.com/49539 47 // Test is flaky. http://crbug.com/49539
47 TEST_F(CollectedCookiesTest, FLAKY_NavigateAway) { 48 TEST_F(CollectedCookiesTest, FLAKY_NavigateAway) {
48 scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); 49 scoped_refptr<net::HTTPTestServer> server(
50 net::HTTPTestServer::CreateServer(kDocRoot));
49 ASSERT_TRUE(NULL != server.get()); 51 ASSERT_TRUE(NULL != server.get());
50 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 52 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
51 ASSERT_TRUE(browser.get()); 53 ASSERT_TRUE(browser.get());
52 54
53 scoped_refptr<TabProxy> tab(browser->GetTab(0)); 55 scoped_refptr<TabProxy> tab(browser->GetTab(0));
54 ASSERT_TRUE(tab.get()); 56 ASSERT_TRUE(tab.get());
55 57
56 // Disable cookies. 58 // Disable cookies.
57 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 59 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
58 CONTENT_SETTING_BLOCK)); 60 CONTENT_SETTING_BLOCK));
59 61
60 // Load a page with cookies. 62 // Load a page with cookies.
61 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html"))); 63 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie1.html")));
62 64
63 // Click on the info link. 65 // Click on the info link.
64 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 66 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
65 67
66 // Navigate to another page. 68 // Navigate to another page.
67 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie2.html"))); 69 ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/cookie2.html")));
68 } 70 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view_browsertest.cc ('k') | chrome/browser/debugger/devtools_sanity_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698