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/scoped_observer.h" | 7 #include "base/scoped_observer.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 EXPECT_TRUE(IsBackgroundPageAlive(last_loaded_extension_id())); | 330 EXPECT_TRUE(IsBackgroundPageAlive(last_loaded_extension_id())); |
331 | 331 |
332 // Navigate away from the NTP, which should close the event page. | 332 // Navigate away from the NTP, which should close the event page. |
333 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 333 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
334 lazybg.Wait(); | 334 lazybg.Wait(); |
335 | 335 |
336 // Lazy Background Page has been shut down. | 336 // Lazy Background Page has been shut down. |
337 EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id())); | 337 EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id())); |
338 } | 338 } |
339 | 339 |
340 // See crbug.com/248437 | |
341 #if defined(OS_WIN) | |
342 #define MAYBE_IncognitoSplitMode DISABLED_IncognitoSplitMode | |
343 #else | |
344 #define MAYBE_IncognitoSplitMode IncognitoSplitMode | |
345 #endif | |
346 | |
347 // Tests that an incognito split mode extension gets 2 lazy background pages, | 340 // Tests that an incognito split mode extension gets 2 lazy background pages, |
348 // and they each load and unload at the proper times. | 341 // and they each load and unload at the proper times. |
349 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, MAYBE_IncognitoSplitMode) { | 342 // See crbug.com/248437 |
| 343 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, DISABLED_IncognitoSplitMode) { |
350 // Open incognito window. | 344 // Open incognito window. |
351 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( | 345 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( |
352 browser()->profile(), GURL("about:blank")); | 346 browser()->profile(), GURL("about:blank")); |
353 | 347 |
354 // Load the extension with incognito enabled. | 348 // Load the extension with incognito enabled. |
355 { | 349 { |
356 LoadedIncognitoObserver loaded(browser()->profile()); | 350 LoadedIncognitoObserver loaded(browser()->profile()); |
357 base::FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page"). | 351 base::FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page"). |
358 AppendASCII("incognito_split"); | 352 AppendASCII("incognito_split"); |
359 ASSERT_TRUE(LoadExtensionIncognito(extdir)); | 353 ASSERT_TRUE(LoadExtensionIncognito(extdir)); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 569 |
576 // Tests that the lazy background page will be unloaded if the onSuspend event | 570 // Tests that the lazy background page will be unloaded if the onSuspend event |
577 // handler calls an API function such as chrome.storage.local.set(). | 571 // handler calls an API function such as chrome.storage.local.set(). |
578 // See: http://crbug.com/296834 | 572 // See: http://crbug.com/296834 |
579 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 573 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
580 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 574 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
581 } | 575 } |
582 | 576 |
583 // TODO: background page with timer. | 577 // TODO: background page with timer. |
584 // TODO: background page that interacts with popup. | 578 // TODO: background page that interacts with popup. |
OLD | NEW |