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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 // Lazy Background Page has been shut down. | 380 // Lazy Background Page has been shut down. |
381 EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id())); | 381 EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id())); |
382 } | 382 } |
383 | 383 |
384 // Tests that an incognito split mode extension gets 2 lazy background pages, | 384 // Tests that an incognito split mode extension gets 2 lazy background pages, |
385 // and they each load and unload at the proper times. | 385 // and they each load and unload at the proper times. |
386 // See crbug.com/248437 | 386 // See crbug.com/248437 |
387 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, DISABLED_IncognitoSplitMode) { | 387 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, DISABLED_IncognitoSplitMode) { |
388 // Open incognito window. | 388 // Open incognito window. |
389 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( | 389 Browser* incognito_browser = |
390 browser()->profile(), GURL("about:blank")); | 390 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
391 | 391 |
392 // Load the extension with incognito enabled. | 392 // Load the extension with incognito enabled. |
393 { | 393 { |
394 LoadedIncognitoObserver loaded(browser()->profile()); | 394 LoadedIncognitoObserver loaded(browser()->profile()); |
395 base::FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page"). | 395 base::FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page"). |
396 AppendASCII("incognito_split"); | 396 AppendASCII("incognito_split"); |
397 ASSERT_TRUE(LoadExtensionIncognito(extdir)); | 397 ASSERT_TRUE(LoadExtensionIncognito(extdir)); |
398 loaded.Wait(); | 398 loaded.Wait(); |
399 } | 399 } |
400 | 400 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 623 |
624 // Tests that the lazy background page will be unloaded if the onSuspend event | 624 // Tests that the lazy background page will be unloaded if the onSuspend event |
625 // handler calls an API function such as chrome.storage.local.set(). | 625 // handler calls an API function such as chrome.storage.local.set(). |
626 // See: http://crbug.com/296834 | 626 // See: http://crbug.com/296834 |
627 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 627 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
628 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 628 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
629 } | 629 } |
630 | 630 |
631 // TODO: background page with timer. | 631 // TODO: background page with timer. |
632 // TODO: background page that interacts with popup. | 632 // TODO: background page that interacts with popup. |
OLD | NEW |