| 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 11 matching lines...) Expand all Loading... |
| 22 scoped_refptr<BrowserProxy> window_proxy(automation()->GetBrowserWindow(0)); | 22 scoped_refptr<BrowserProxy> window_proxy(automation()->GetBrowserWindow(0)); |
| 23 if (!window_proxy.get()) | 23 if (!window_proxy.get()) |
| 24 return false; | 24 return false; |
| 25 | 25 |
| 26 bool timed_out; | 26 bool timed_out; |
| 27 return window_proxy->IsPageMenuCommandEnabledWithTimeout( | 27 return window_proxy->IsPageMenuCommandEnabledWithTimeout( |
| 28 command, 5000, &timed_out) && !timed_out; | 28 command, 5000, &timed_out) && !timed_out; |
| 29 } | 29 } |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 std::wstring test_html_; | 32 std::wstring test_html_; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // This test renders a page in view-source and then checks to see if a cookie | 35 // This test renders a page in view-source and then checks to see if a cookie |
| 36 // set in the html was set successfully (it shouldn't because we rendered the | 36 // set in the html was set successfully (it shouldn't because we rendered the |
| 37 // page in view source) | 37 // page in view source) |
| 38 TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { | 38 TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { |
| 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"; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // First we navigate to google.html | 102 // First we navigate to google.html |
| 103 GURL url = server->TestServerPageW(test_html_); | 103 GURL url = server->TestServerPageW(test_html_); |
| 104 GURL url_viewsource = GURL("view-source:" + url.spec()); | 104 GURL url_viewsource = GURL("view-source:" + url.spec()); |
| 105 NavigateToURL(url_viewsource); | 105 NavigateToURL(url_viewsource); |
| 106 | 106 |
| 107 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); | 107 EXPECT_FALSE(IsPageMenuCommandEnabled(IDC_VIEW_SOURCE)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace | 110 } // namespace |
| OLD | NEW |