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 "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 hostname, ip_literal, static_cast<int>(net_error), | 221 hostname, ip_literal, static_cast<int>(net_error), |
222 static_cast<int>(expire_days_from_now))); | 222 static_cast<int>(expire_days_from_now))); |
223 } | 223 } |
224 | 224 |
225 void NetInternalsTest::MessageHandler::LoadPage( | 225 void NetInternalsTest::MessageHandler::LoadPage( |
226 const base::ListValue* list_value) { | 226 const base::ListValue* list_value) { |
227 std::string url; | 227 std::string url; |
228 ASSERT_TRUE(list_value->GetString(0, &url)); | 228 ASSERT_TRUE(list_value->GetString(0, &url)); |
229 LOG(WARNING) << "url: [" << url << "]"; | 229 LOG(WARNING) << "url: [" << url << "]"; |
230 ui_test_utils::NavigateToURLWithDisposition( | 230 ui_test_utils::NavigateToURLWithDisposition( |
231 browser(), | 231 browser(), GURL(url), WindowOpenDisposition::NEW_BACKGROUND_TAB, |
232 GURL(url), | |
233 NEW_BACKGROUND_TAB, | |
234 ui_test_utils::BROWSER_TEST_NONE); | 232 ui_test_utils::BROWSER_TEST_NONE); |
235 } | 233 } |
236 | 234 |
237 void NetInternalsTest::MessageHandler::PrerenderPage( | 235 void NetInternalsTest::MessageHandler::PrerenderPage( |
238 const base::ListValue* list_value) { | 236 const base::ListValue* list_value) { |
239 std::string prerender_url; | 237 std::string prerender_url; |
240 ASSERT_TRUE(list_value->GetString(0, &prerender_url)); | 238 ASSERT_TRUE(list_value->GetString(0, &prerender_url)); |
241 GURL loader_url = | 239 GURL loader_url = |
242 net_internals_test_->CreatePrerenderLoaderUrl(GURL(prerender_url)); | 240 net_internals_test_->CreatePrerenderLoaderUrl(GURL(prerender_url)); |
243 ui_test_utils::NavigateToURLWithDisposition( | 241 ui_test_utils::NavigateToURLWithDisposition( |
244 browser(), | 242 browser(), GURL(loader_url), WindowOpenDisposition::NEW_BACKGROUND_TAB, |
245 GURL(loader_url), | |
246 NEW_BACKGROUND_TAB, | |
247 ui_test_utils::BROWSER_TEST_NONE); | 243 ui_test_utils::BROWSER_TEST_NONE); |
248 } | 244 } |
249 | 245 |
250 void NetInternalsTest::MessageHandler::NavigateToPrerender( | 246 void NetInternalsTest::MessageHandler::NavigateToPrerender( |
251 const base::ListValue* list_value) { | 247 const base::ListValue* list_value) { |
252 std::string url; | 248 std::string url; |
253 ASSERT_TRUE(list_value->GetString(0, &url)); | 249 ASSERT_TRUE(list_value->GetString(0, &url)); |
254 content::RenderFrameHost* frame = | 250 content::RenderFrameHost* frame = |
255 browser()->tab_strip_model()->GetWebContentsAt(1)->GetMainFrame(); | 251 browser()->tab_strip_model()->GetWebContentsAt(1)->GetMainFrame(); |
256 frame->ExecuteJavaScriptForTests( | 252 frame->ExecuteJavaScriptForTests( |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 if (test_server_started_) | 366 if (test_server_started_) |
371 return true; | 367 return true; |
372 test_server_started_ = embedded_test_server()->Start(); | 368 test_server_started_ = embedded_test_server()->Start(); |
373 | 369 |
374 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1 | 370 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1 |
375 // are forbidden. | 371 // are forbidden. |
376 host_resolver()->AddRule("testdomain.com", "127.0.0.1"); | 372 host_resolver()->AddRule("testdomain.com", "127.0.0.1"); |
377 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1"); | 373 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1"); |
378 return test_server_started_; | 374 return test_server_started_; |
379 } | 375 } |
OLD | NEW |