Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/browser/extensions/lazy_background_page_apitest.cc

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698