| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 ExtensionTestMessageListener page_ready("ready", true); | 569 ExtensionTestMessageListener page_ready("ready", true); |
| 570 GURL page_url = extension->GetResourceURL("page.html"); | 570 GURL page_url = extension->GetResourceURL("page.html"); |
| 571 ui_test_utils::NavigateToURL(browser(), page_url); | 571 ui_test_utils::NavigateToURL(browser(), page_url); |
| 572 EXPECT_TRUE(page_ready.WaitUntilSatisfied()); | 572 EXPECT_TRUE(page_ready.WaitUntilSatisfied()); |
| 573 | 573 |
| 574 // After the event is sent below, wait for the event page to have received | 574 // After the event is sent below, wait for the event page to have received |
| 575 // the event before proceeding with the test. This allows the regular page | 575 // the event before proceeding with the test. This allows the regular page |
| 576 // to test that the event page received the event, which makes the pass/fail | 576 // to test that the event page received the event, which makes the pass/fail |
| 577 // logic simpler. | 577 // logic simpler. |
| 578 ExtensionTestMessageListener event_page_ready("ready", true); | 578 ExtensionTestMessageListener event_page_ready("ready", false); |
| 579 | 579 |
| 580 // Send an event by making a bookmark. | 580 // Send an event by making a bookmark. |
| 581 BookmarkModel* bookmark_model = | 581 BookmarkModel* bookmark_model = |
| 582 BookmarkModelFactory::GetForProfile(browser()->profile()); | 582 BookmarkModelFactory::GetForProfile(browser()->profile()); |
| 583 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); | 583 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); |
| 584 bookmarks::AddIfNotBookmarked(bookmark_model, | 584 bookmarks::AddIfNotBookmarked(bookmark_model, |
| 585 GURL("http://www.google.com"), | 585 GURL("http://www.google.com"), |
| 586 base::UTF8ToUTF16("Google")); | 586 base::UTF8ToUTF16("Google")); |
| 587 | 587 |
| 588 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied()); | 588 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied()); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 // handler calls an API function such as chrome.storage.local.set(). | 653 // handler calls an API function such as chrome.storage.local.set(). |
| 654 // See: http://crbug.com/296834 | 654 // See: http://crbug.com/296834 |
| 655 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 655 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
| 656 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 656 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
| 657 } | 657 } |
| 658 | 658 |
| 659 // TODO: background page with timer. | 659 // TODO: background page with timer. |
| 660 // TODO: background page that interacts with popup. | 660 // TODO: background page that interacts with popup. |
| 661 | 661 |
| 662 } // namespace extensions | 662 } // namespace extensions |
| OLD | NEW |