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/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/scoped_observer.h" | 6 #include "base/scoped_observer.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/extensions/browser_action_test_util.h" | 9 #include "chrome/browser/extensions/browser_action_test_util.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "extensions/browser/extension_registry_observer.h" | 27 #include "extensions/browser/extension_registry_observer.h" |
28 #include "extensions/browser/process_manager.h" | 28 #include "extensions/browser/process_manager.h" |
29 #include "extensions/common/extension.h" | 29 #include "extensions/common/extension.h" |
30 #include "extensions/test/extension_test_message_listener.h" | 30 #include "extensions/test/extension_test_message_listener.h" |
31 #include "extensions/test/result_catcher.h" | 31 #include "extensions/test/result_catcher.h" |
32 #include "net/dns/mock_host_resolver.h" | 32 #include "net/dns/mock_host_resolver.h" |
33 #include "net/test/embedded_test_server/embedded_test_server.h" | 33 #include "net/test/embedded_test_server/embedded_test_server.h" |
34 #include "url/gurl.h" | 34 #include "url/gurl.h" |
35 | 35 |
36 using bookmarks::BookmarkModel; | 36 using bookmarks::BookmarkModel; |
| 37 using bookmarks::BookmarkNode; |
37 using extensions::Extension; | 38 using extensions::Extension; |
38 using extensions::ResultCatcher; | 39 using extensions::ResultCatcher; |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 // This unfortunate bit of silliness is necessary when loading an extension in | 43 // This unfortunate bit of silliness is necessary when loading an extension in |
43 // incognito. The goal is to load the extension, enable incognito, then wait | 44 // incognito. The goal is to load the extension, enable incognito, then wait |
44 // for both background pages to load and close. The problem is that enabling | 45 // for both background pages to load and close. The problem is that enabling |
45 // incognito involves reloading the extension - and the background pages may | 46 // incognito involves reloading the extension - and the background pages may |
46 // have already loaded once before then. So we wait until the extension is | 47 // have already loaded once before then. So we wait until the extension is |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 562 |
562 // Tests that the lazy background page will be unloaded if the onSuspend event | 563 // Tests that the lazy background page will be unloaded if the onSuspend event |
563 // handler calls an API function such as chrome.storage.local.set(). | 564 // handler calls an API function such as chrome.storage.local.set(). |
564 // See: http://crbug.com/296834 | 565 // See: http://crbug.com/296834 |
565 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 566 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
566 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 567 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
567 } | 568 } |
568 | 569 |
569 // TODO: background page with timer. | 570 // TODO: background page with timer. |
570 // TODO: background page that interacts with popup. | 571 // TODO: background page that interacts with popup. |
OLD | NEW |