| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 public InstantTestBase { | 2371 public InstantTestBase { |
| 2372 public: | 2372 public: |
| 2373 InstantExtendedFirstTabTest() {} | 2373 InstantExtendedFirstTabTest() {} |
| 2374 protected: | 2374 protected: |
| 2375 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2375 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2376 command_line->AppendSwitch(switches::kEnableInstantExtendedAPI); | 2376 command_line->AppendSwitch(switches::kEnableInstantExtendedAPI); |
| 2377 command_line->AppendSwitch(switches::kDisableLocalFirstLoadNTP); | 2377 command_line->AppendSwitch(switches::kDisableLocalFirstLoadNTP); |
| 2378 } | 2378 } |
| 2379 }; | 2379 }; |
| 2380 | 2380 |
| 2381 // Flaky: http://crbug.com/238863 |
| 2382 #if defined(OS_CHROMEOS) |
| 2383 #define MAYBE_RedirectToLocalOnLoadFailure DISABLED_RedirectToLocalOnLoadFailure |
| 2384 #else |
| 2385 #define MAYBE_RedirectToLocalOnLoadFailure RedirectToLocalOnLoadFailure |
| 2386 #endif |
| 2381 IN_PROC_BROWSER_TEST_F( | 2387 IN_PROC_BROWSER_TEST_F( |
| 2382 InstantExtendedFirstTabTest, RedirectToLocalOnLoadFailure) { | 2388 InstantExtendedFirstTabTest, MAYBE_RedirectToLocalOnLoadFailure) { |
| 2383 // Create a new window to test the first NTP load. | 2389 // Create a new window to test the first NTP load. |
| 2384 ui_test_utils::NavigateToURLWithDisposition( | 2390 ui_test_utils::NavigateToURLWithDisposition( |
| 2385 browser(), | 2391 browser(), |
| 2386 GURL(chrome::kChromeUINewTabURL), | 2392 GURL(chrome::kChromeUINewTabURL), |
| 2387 NEW_WINDOW, | 2393 NEW_WINDOW, |
| 2388 ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); | 2394 ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); |
| 2389 | 2395 |
| 2390 const BrowserList* native_browser_list = BrowserList::GetInstance( | 2396 const BrowserList* native_browser_list = BrowserList::GetInstance( |
| 2391 chrome::HOST_DESKTOP_TYPE_NATIVE); | 2397 chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 2392 ASSERT_EQ(2u, native_browser_list->size()); | 2398 ASSERT_EQ(2u, native_browser_list->size()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2407 EXPECT_TRUE(instant()->ntp()->IsLocal()); | 2413 EXPECT_TRUE(instant()->ntp()->IsLocal()); |
| 2408 | 2414 |
| 2409 // Overlay contents should be preloaded. | 2415 // Overlay contents should be preloaded. |
| 2410 ASSERT_NE(static_cast<InstantOverlay*>(NULL), instant()->overlay()); | 2416 ASSERT_NE(static_cast<InstantOverlay*>(NULL), instant()->overlay()); |
| 2411 EXPECT_TRUE(instant()->overlay()->IsLocal()); | 2417 EXPECT_TRUE(instant()->overlay()->IsLocal()); |
| 2412 | 2418 |
| 2413 // Instant tab contents should be preloaded. | 2419 // Instant tab contents should be preloaded. |
| 2414 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab()); | 2420 ASSERT_NE(static_cast<InstantTab*>(NULL), instant()->instant_tab()); |
| 2415 EXPECT_TRUE(instant()->instant_tab()->IsLocal()); | 2421 EXPECT_TRUE(instant()->instant_tab()->IsLocal()); |
| 2416 } | 2422 } |
| OLD | NEW |