| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/time.h" | 5 #include "base/time.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| 11 #include "content/browser/renderer_host/render_view_host_impl.h" | 11 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 12 #include "content/browser/tab_contents/tab_contents.h" |
| 13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
| 14 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "net/base/host_port_pair.h" | 16 #include "net/base/host_port_pair.h" |
| 17 #include "net/base/net_util.h" | 17 #include "net/base/net_util.h" |
| 18 #include "net/test/test_server.h" | 18 #include "net/test/test_server.h" |
| 19 | 19 |
| 20 using content::RenderViewHostImpl; |
| 20 using content::WebContents; | 21 using content::WebContents; |
| 21 | 22 |
| 22 class RenderViewHostTest : public InProcessBrowserTest { | 23 class RenderViewHostTest : public InProcessBrowserTest { |
| 23 public: | 24 public: |
| 24 RenderViewHostTest() {} | 25 RenderViewHostTest() {} |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 | 28 |
| 28 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, | 29 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, |
| 29 ExecuteJavascriptAndGetValue) { | 30 ExecuteJavascriptAndGetValue) { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 ui_test_utils::NavigateToURL(browser(), test_url); | 221 ui_test_utils::NavigateToURL(browser(), test_url); |
| 221 EXPECT_TRUE(observer.base_url().is_empty()); | 222 EXPECT_TRUE(observer.base_url().is_empty()); |
| 222 EXPECT_EQ(1, observer.navigation_count()); | 223 EXPECT_EQ(1, observer.navigation_count()); |
| 223 | 224 |
| 224 // But should be set to the original page when reading MHTML. | 225 // But should be set to the original page when reading MHTML. |
| 225 test_url = net::FilePathToFileURL(test_server()->document_root().Append( | 226 test_url = net::FilePathToFileURL(test_server()->document_root().Append( |
| 226 FILE_PATH_LITERAL("google.mht"))); | 227 FILE_PATH_LITERAL("google.mht"))); |
| 227 ui_test_utils::NavigateToURL(browser(), test_url); | 228 ui_test_utils::NavigateToURL(browser(), test_url); |
| 228 EXPECT_EQ("http://www.google.com/", observer.base_url().spec()); | 229 EXPECT_EQ("http://www.google.com/", observer.base_url().spec()); |
| 229 } | 230 } |
| OLD | NEW |