| OLD | NEW |
| 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 "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" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 browser()->GetSelectedTabContents()); | 200 browser()->GetSelectedTabContents()); |
| 201 | 201 |
| 202 GURL test_url = test_server()->GetURL("files/simple.html"); | 202 GURL test_url = test_server()->GetURL("files/simple.html"); |
| 203 ui_test_utils::NavigateToURL(browser(), test_url); | 203 ui_test_utils::NavigateToURL(browser(), test_url); |
| 204 | 204 |
| 205 EXPECT_EQ(test_server()->host_port_pair().ToString(), | 205 EXPECT_EQ(test_server()->host_port_pair().ToString(), |
| 206 observer.observed_socket_address().ToString()); | 206 observer.observed_socket_address().ToString()); |
| 207 EXPECT_EQ(1, observer.navigation_count()); | 207 EXPECT_EQ(1, observer.navigation_count()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 // TODO(jcivelli): temporarily disabled while I figure-out why the EOL is | 210 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BaseURLParam) { |
| 211 // getting messed-up in google.mht (causing it to fail to load). | |
| 212 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, DISABLED_BaseURLParam) { | |
| 213 ASSERT_TRUE(test_server()->Start()); | 211 ASSERT_TRUE(test_server()->Start()); |
| 214 RenderViewHostTestTabContentsObserver observer( | 212 RenderViewHostTestTabContentsObserver observer( |
| 215 browser()->GetSelectedTabContents()); | 213 browser()->GetSelectedTabContents()); |
| 216 | 214 |
| 217 // Base URL is not set if it is the same as the URL. | 215 // Base URL is not set if it is the same as the URL. |
| 218 GURL test_url = test_server()->GetURL("files/simple.html"); | 216 GURL test_url = test_server()->GetURL("files/simple.html"); |
| 219 ui_test_utils::NavigateToURL(browser(), test_url); | 217 ui_test_utils::NavigateToURL(browser(), test_url); |
| 220 EXPECT_TRUE(observer.base_url().is_empty()); | 218 EXPECT_TRUE(observer.base_url().is_empty()); |
| 221 EXPECT_EQ(1, observer.navigation_count()); | 219 EXPECT_EQ(1, observer.navigation_count()); |
| 222 | 220 |
| 223 // But should be set to the original page when reading MHTML. | 221 // But should be set to the original page when reading MHTML. |
| 224 test_url = net::FilePathToFileURL(test_server()->document_root().Append( | 222 test_url = net::FilePathToFileURL(test_server()->document_root().Append( |
| 225 FILE_PATH_LITERAL("google.mht"))); | 223 FILE_PATH_LITERAL("google.mht"))); |
| 226 ui_test_utils::NavigateToURL(browser(), test_url); | 224 ui_test_utils::NavigateToURL(browser(), test_url); |
| 227 EXPECT_EQ("http://www.google.com/", observer.base_url().spec()); | 225 EXPECT_EQ("http://www.google.com/", observer.base_url().spec()); |
| 228 } | 226 } |
| OLD | NEW |