OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/app/chrome_dll_resource.h" | 5 #include "chrome/app/chrome_dll_resource.h" |
6 #include "chrome/test/automation/browser_proxy.h" | 6 #include "chrome/test/automation/browser_proxy.h" |
7 #include "chrome/test/automation/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
8 #include "chrome/test/ui/ui_test.h" | 8 #include "chrome/test/ui/ui_test.h" |
9 #include "net/url_request/url_request_unittest.h" | 9 #include "net/url_request/url_request_unittest.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 scoped_refptr<HTTPTestServer> server = | 39 scoped_refptr<HTTPTestServer> server = |
40 HTTPTestServer::CreateServer(kDocRoot, NULL); | 40 HTTPTestServer::CreateServer(kDocRoot, NULL); |
41 ASSERT_TRUE(NULL != server.get()); | 41 ASSERT_TRUE(NULL != server.get()); |
42 std::string cookie = "viewsource_cookie"; | 42 std::string cookie = "viewsource_cookie"; |
43 std::string cookie_data = "foo"; | 43 std::string cookie_data = "foo"; |
44 | 44 |
45 // First we navigate to our view-source test page | 45 // First we navigate to our view-source test page |
46 GURL url = server->TestServerPageW(test_html_); | 46 GURL url = server->TestServerPageW(test_html_); |
47 url = GURL("view-source:" + url.spec()); | 47 url = GURL("view-source:" + url.spec()); |
48 scoped_refptr<TabProxy> tab(GetActiveTab()); | 48 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 49 ASSERT_TRUE(tab.get()); |
49 tab->NavigateToURL(url); | 50 tab->NavigateToURL(url); |
50 PlatformThread::Sleep(sleep_timeout_ms()); | 51 PlatformThread::Sleep(sleep_timeout_ms()); |
51 | 52 |
52 // Try to retrieve the cookie that the page sets | 53 // Try to retrieve the cookie that the page sets |
53 // It should not be there (because we are in view-source mode | 54 // It should not be there (because we are in view-source mode |
54 std::string cookie_found; | 55 std::string cookie_found; |
55 tab->GetCookieByName(url, cookie, &cookie_found); | 56 tab->GetCookieByName(url, cookie, &cookie_found); |
56 EXPECT_NE(cookie_data, cookie_found); | 57 EXPECT_NE(cookie_data, cookie_found); |
57 } | 58 } |
58 | 59 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 // First we navigate to google.html | 102 // First we navigate to google.html |
102 GURL url = server->TestServerPageW(test_html_); | 103 GURL url = server->TestServerPageW(test_html_); |
103 GURL url_viewsource = GURL("view-source:" + url.spec()); | 104 GURL url_viewsource = GURL("view-source:" + url.spec()); |
104 NavigateToURL(url_viewsource); | 105 NavigateToURL(url_viewsource); |
105 | 106 |
106 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); | 107 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); |
107 } | 108 } |
108 | 109 |
109 } // namespace | 110 } // namespace |
OLD | NEW |