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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" | 10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 // the event before proceeding with the test. This allows the regular page | 505 // the event before proceeding with the test. This allows the regular page |
506 // to test that the event page received the event, which makes the pass/fail | 506 // to test that the event page received the event, which makes the pass/fail |
507 // logic simpler. | 507 // logic simpler. |
508 ExtensionTestMessageListener event_page_ready("ready", true); | 508 ExtensionTestMessageListener event_page_ready("ready", true); |
509 | 509 |
510 // Send an event by making a bookmark. | 510 // Send an event by making a bookmark. |
511 BookmarkModel* bookmark_model = | 511 BookmarkModel* bookmark_model = |
512 BookmarkModelFactory::GetForProfile(browser()->profile()); | 512 BookmarkModelFactory::GetForProfile(browser()->profile()); |
513 test::WaitForBookmarkModelToLoad(bookmark_model); | 513 test::WaitForBookmarkModelToLoad(bookmark_model); |
514 bookmark_utils::AddIfNotBookmarked(bookmark_model, | 514 bookmark_utils::AddIfNotBookmarked(bookmark_model, |
| 515 bookmark_model, |
515 GURL("http://www.google.com"), | 516 GURL("http://www.google.com"), |
516 base::UTF8ToUTF16("Google")); | 517 base::UTF8ToUTF16("Google")); |
517 | 518 |
518 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied()); | 519 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied()); |
519 | 520 |
520 page_ready.Reply("go"); | 521 page_ready.Reply("go"); |
521 | 522 |
522 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 523 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
523 } | 524 } |
524 | 525 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 | 571 |
571 // Tests that the lazy background page will be unloaded if the onSuspend event | 572 // Tests that the lazy background page will be unloaded if the onSuspend event |
572 // handler calls an API function such as chrome.storage.local.set(). | 573 // handler calls an API function such as chrome.storage.local.set(). |
573 // See: http://crbug.com/296834 | 574 // See: http://crbug.com/296834 |
574 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 575 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
575 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 576 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
576 } | 577 } |
577 | 578 |
578 // TODO: background page with timer. | 579 // TODO: background page with timer. |
579 // TODO: background page that interacts with popup. | 580 // TODO: background page that interacts with popup. |
OLD | NEW |