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

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

Issue 25238003: Will now DCHECK that test writers start the embedded server before using it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing tests which did not init embedded test server Created 7 years, 2 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 | Annotate | Revision Log
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); 167 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_));
168 168
169 // Page action is shown. 169 // Page action is shown.
170 page_action_changed.Wait(); 170 page_action_changed.Wait();
171 EXPECT_EQ(num_page_actions + 1, 171 EXPECT_EQ(num_page_actions + 1,
172 browser()->window()->GetLocationBar()-> 172 browser()->window()->GetLocationBar()->
173 GetLocationBarForTesting()->PageActionVisibleCount()); 173 GetLocationBarForTesting()->PageActionVisibleCount());
174 } 174 }
175 175
176 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, Filters) { 176 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, Filters) {
177 ASSERT_TRUE(StartEmbeddedTestServer());
178
177 const Extension* extension = LoadExtensionAndWait("filters"); 179 const Extension* extension = LoadExtensionAndWait("filters");
178 ASSERT_TRUE(extension); 180 ASSERT_TRUE(extension);
179 181
180 // Lazy Background Page doesn't exist yet. 182 // Lazy Background Page doesn't exist yet.
181 ExtensionProcessManager* pm = 183 ExtensionProcessManager* pm =
182 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); 184 extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
183 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); 185 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_));
184 186
185 // Open a tab to a URL that will fire a webNavigation event. 187 // Open a tab to a URL that will fire a webNavigation event.
186 LazyBackgroundObserver page_complete; 188 LazyBackgroundObserver page_complete;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 507
506 // Tests that the lazy background page will be unloaded if the onSuspend event 508 // Tests that the lazy background page will be unloaded if the onSuspend event
507 // handler calls an API function such as chrome.storage.local.set(). 509 // handler calls an API function such as chrome.storage.local.set().
508 // See: http://crbug.com/296834 510 // See: http://crbug.com/296834
509 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { 511 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) {
510 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); 512 EXPECT_TRUE(LoadExtensionAndWait("on_suspend"));
511 } 513 }
512 514
513 // TODO: background page with timer. 515 // TODO: background page with timer.
514 // TODO: background page that interacts with popup. 516 // TODO: background page that interacts with popup.
OLDNEW
« no previous file with comments | « chrome/browser/collected_cookies_browsertest.cc ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698