OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 |
11 namespace { | 11 namespace { |
(...skipping 30 matching lines...) Expand all Loading... |
42 HTTPTestServer::CreateServer(kDocRoot, NULL); | 42 HTTPTestServer::CreateServer(kDocRoot, NULL); |
43 ASSERT_TRUE(NULL != server.get()); | 43 ASSERT_TRUE(NULL != server.get()); |
44 std::string cookie = "viewsource_cookie"; | 44 std::string cookie = "viewsource_cookie"; |
45 std::string cookie_data = "foo"; | 45 std::string cookie_data = "foo"; |
46 | 46 |
47 // First we navigate to our view-source test page | 47 // First we navigate to our view-source test page |
48 GURL url = server->TestServerPageW(test_html_); | 48 GURL url = server->TestServerPageW(test_html_); |
49 url = GURL("view-source:" + url.spec()); | 49 url = GURL("view-source:" + url.spec()); |
50 scoped_ptr<TabProxy> tab(GetActiveTab()); | 50 scoped_ptr<TabProxy> tab(GetActiveTab()); |
51 tab->NavigateToURL(url); | 51 tab->NavigateToURL(url); |
52 Sleep(sleep_timeout_ms()); | 52 PlatformThread::Sleep(sleep_timeout_ms()); |
53 | 53 |
54 // Try to retrieve the cookie that the page sets | 54 // Try to retrieve the cookie that the page sets |
55 // It should not be there (because we are in view-source mode | 55 // It should not be there (because we are in view-source mode |
56 std::string cookie_found; | 56 std::string cookie_found; |
57 tab->GetCookieByName(url, cookie, &cookie_found); | 57 tab->GetCookieByName(url, cookie, &cookie_found); |
58 EXPECT_NE(cookie_data, cookie_found); | 58 EXPECT_NE(cookie_data, cookie_found); |
59 } | 59 } |
60 | 60 |
61 // This test renders a page normally and then renders the same page in | 61 // This test renders a page normally and then renders the same page in |
62 // view-source mode. This is done since we had a problem at one point during | 62 // view-source mode. This is done since we had a problem at one point during |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 HTTPTestServer::CreateServer(kDocRoot, NULL); | 100 HTTPTestServer::CreateServer(kDocRoot, NULL); |
101 ASSERT_TRUE(NULL != server.get()); | 101 ASSERT_TRUE(NULL != server.get()); |
102 | 102 |
103 // First we navigate to google.html | 103 // First we navigate to google.html |
104 GURL url = server->TestServerPageW(test_html_); | 104 GURL url = server->TestServerPageW(test_html_); |
105 GURL url_viewsource = GURL("view-source:" + url.spec()); | 105 GURL url_viewsource = GURL("view-source:" + url.spec()); |
106 NavigateToURL(url_viewsource); | 106 NavigateToURL(url_viewsource); |
107 | 107 |
108 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); | 108 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); |
109 } | 109 } |
OLD | NEW |