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

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

Issue 11728003: Change ExecuteJavaScript* helper functions in browser_test_utils.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding files for gpu_tests and NaCl browser tests. Created 7 years, 11 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/file_path.h" 6 #include "base/file_path.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/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/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/bookmarks/bookmark_utils.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // Lazy Background Page still exists, because the extension started a request. 249 // Lazy Background Page still exists, because the extension started a request.
250 ExtensionProcessManager* pm = 250 ExtensionProcessManager* pm =
251 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); 251 extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
252 extensions::ExtensionHost* host = 252 extensions::ExtensionHost* host =
253 pm->GetBackgroundHostForExtension(last_loaded_extension_id_); 253 pm->GetBackgroundHostForExtension(last_loaded_extension_id_);
254 ASSERT_TRUE(host); 254 ASSERT_TRUE(host);
255 255
256 // Abort the request. 256 // Abort the request.
257 bool result = false; 257 bool result = false;
258 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool( 258 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
259 host->render_view_host(), std::wstring(), L"abortRequest()", &result)); 259 host->render_view_host(), "", "abortRequest()", &result));
260 EXPECT_TRUE(result); 260 EXPECT_TRUE(result);
261 page_complete.Wait(); 261 page_complete.Wait();
262 262
263 // Lazy Background Page has been shut down. 263 // Lazy Background Page has been shut down.
264 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); 264 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_));
265 } 265 }
266 266
267 // Tests that the lazy background page stays alive until all visible views are 267 // Tests that the lazy background page stays alive until all visible views are
268 // closed. 268 // closed.
269 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, WaitForNTP) { 269 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, WaitForNTP) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied()); 442 EXPECT_TRUE(event_page_ready.WaitUntilSatisfied());
443 443
444 page_ready.Reply("go"); 444 page_ready.Reply("go");
445 445
446 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 446 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
447 } 447 }
448 448
449 // TODO: background page with timer. 449 // TODO: background page with timer.
450 // TODO: background page that interacts with popup. 450 // TODO: background page that interacts with popup.
OLDNEW
« no previous file with comments | « chrome/browser/extensions/isolated_app_browsertest.cc ('k') | chrome/browser/extensions/options_page_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698