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

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

Issue 9372065: Update clients to use new TestServer constructor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove files that were reviewed and committed separately. Created 8 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/custom_handlers/custom_handlers_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/net/url_fixer_upper.h" 8 #include "chrome/browser/net/url_fixer_upper.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/test/automation/automation_proxy.h" 10 #include "chrome/test/automation/automation_proxy.h"
(...skipping 10 matching lines...) Expand all
21 21
22 typedef UITest CollectedCookiesTest; 22 typedef UITest CollectedCookiesTest;
23 23
24 // Crashing on Windows, see http://crbug.com/79331 24 // Crashing on Windows, see http://crbug.com/79331
25 #if defined(OS_WIN) 25 #if defined(OS_WIN)
26 #define MAYBE_DoubleDisplay DISABLED_DoubleDisplay 26 #define MAYBE_DoubleDisplay DISABLED_DoubleDisplay
27 #else 27 #else
28 #define MAYBE_DoubleDisplay DoubleDisplay 28 #define MAYBE_DoubleDisplay DoubleDisplay
29 #endif 29 #endif
30 TEST_F(CollectedCookiesTest, MAYBE_DoubleDisplay) { 30 TEST_F(CollectedCookiesTest, MAYBE_DoubleDisplay) {
31 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); 31 net::TestServer test_server(net::TestServer::TYPE_HTTP,
32 net::TestServer::kLocalhost,
33 FilePath(kDocRoot));
32 ASSERT_TRUE(test_server.Start()); 34 ASSERT_TRUE(test_server.Start());
33 35
34 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 36 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
35 ASSERT_TRUE(browser.get()); 37 ASSERT_TRUE(browser.get());
36 38
37 scoped_refptr<TabProxy> tab(browser->GetTab(0)); 39 scoped_refptr<TabProxy> tab(browser->GetTab(0));
38 ASSERT_TRUE(tab.get()); 40 ASSERT_TRUE(tab.get());
39 41
40 // Disable cookies. 42 // Disable cookies.
41 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 43 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
42 CONTENT_SETTING_BLOCK)); 44 CONTENT_SETTING_BLOCK));
43 45
44 // Load a page with cookies. 46 // Load a page with cookies.
45 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html"))); 47 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html")));
46 48
47 // Click on the info link twice. 49 // Click on the info link twice.
48 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 50 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
49 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 51 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
50 } 52 }
51 53
52 // Crashing on Windows, see http://crbug.com/79331 54 // Crashing on Windows, see http://crbug.com/79331
53 #if defined(OS_WIN) 55 #if defined(OS_WIN)
54 #define MAYBE_NavigateAway DISABLED_NavigateAway 56 #define MAYBE_NavigateAway DISABLED_NavigateAway
55 #else 57 #else
56 #define MAYBE_NavigateAway NavigateAway 58 #define MAYBE_NavigateAway NavigateAway
57 #endif 59 #endif
58 TEST_F(CollectedCookiesTest, MAYBE_NavigateAway) { 60 TEST_F(CollectedCookiesTest, MAYBE_NavigateAway) {
59 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); 61 net::TestServer test_server(net::TestServer::TYPE_HTTP,
62 net::TestServer::kLocalhost,
63 FilePath(kDocRoot));
60 ASSERT_TRUE(test_server.Start()); 64 ASSERT_TRUE(test_server.Start());
61 65
62 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 66 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
63 ASSERT_TRUE(browser.get()); 67 ASSERT_TRUE(browser.get());
64 68
65 scoped_refptr<TabProxy> tab(browser->GetTab(0)); 69 scoped_refptr<TabProxy> tab(browser->GetTab(0));
66 ASSERT_TRUE(tab.get()); 70 ASSERT_TRUE(tab.get());
67 71
68 // Disable cookies. 72 // Disable cookies.
69 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, 73 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
70 CONTENT_SETTING_BLOCK)); 74 CONTENT_SETTING_BLOCK));
71 75
72 // Load a page with cookies. 76 // Load a page with cookies.
73 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html"))); 77 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie1.html")));
74 78
75 // Click on the info link. 79 // Click on the info link.
76 ASSERT_TRUE(tab->ShowCollectedCookiesDialog()); 80 ASSERT_TRUE(tab->ShowCollectedCookiesDialog());
77 81
78 // Navigate to another page. 82 // Navigate to another page.
79 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie2.html"))); 83 ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/cookie2.html")));
80 } 84 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/custom_handlers/custom_handlers_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698