| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/gtest_prod_util.h" | 7 #include "base/gtest_prod_util.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), observer->current_url()) | 216 EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), observer->current_url()) |
| 217 << test.description; | 217 << test.description; |
| 218 // The navigation to Local NTP should be definitive i.e. can't go back. | 218 // The navigation to Local NTP should be definitive i.e. can't go back. |
| 219 EXPECT_FALSE(observer->can_go_back()); | 219 EXPECT_FALSE(observer->can_go_back()); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 TEST_F(BrowserInstantControllerTest, BrowserWindowLifecycle) { | 224 TEST_F(BrowserInstantControllerTest, BrowserWindowLifecycle) { |
| 225 std::unique_ptr<BrowserWindow> window(CreateBrowserWindow()); | 225 std::unique_ptr<BrowserWindow> window(CreateBrowserWindow()); |
| 226 Browser::CreateParams params(profile()); | 226 Browser::CreateParams params(profile(), true); |
| 227 params.window = window.get(); | 227 params.window = window.get(); |
| 228 std::unique_ptr<Browser> browser(new Browser(params)); | 228 std::unique_ptr<Browser> browser(new Browser(params)); |
| 229 InstantServiceObserver* bic; | 229 InstantServiceObserver* bic; |
| 230 bic = browser->instant_controller(); | 230 bic = browser->instant_controller(); |
| 231 EXPECT_TRUE(IsInstantServiceObserver(bic)) | 231 EXPECT_TRUE(IsInstantServiceObserver(bic)) |
| 232 << "New BrowserInstantController should register as InstantServiceObserver"; | 232 << "New BrowserInstantController should register as InstantServiceObserver"; |
| 233 | 233 |
| 234 browser.reset(NULL); | 234 browser.reset(NULL); |
| 235 window.reset(NULL); | 235 window.reset(NULL); |
| 236 EXPECT_FALSE(IsInstantServiceObserver(bic)) | 236 EXPECT_FALSE(IsInstantServiceObserver(bic)) |
| 237 << "New BrowserInstantController should register as InstantServiceObserver"; | 237 << "New BrowserInstantController should register as InstantServiceObserver"; |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace | 240 } // namespace |
| 241 | 241 |
| 242 } // namespace chrome | 242 } // namespace chrome |
| OLD | NEW |