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

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

Issue 10824030: Move ExtensionHost into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 years, 4 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/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.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/extensions/browser_action_test_util.h" 9 #include "chrome/browser/extensions/browser_action_test_util.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 ResultCatcher catcher; 234 ResultCatcher catcher;
235 FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page"). 235 FilePath extdir = test_data_dir_.AppendASCII("lazy_background_page").
236 AppendASCII("wait_for_request"); 236 AppendASCII("wait_for_request");
237 const Extension* extension = LoadExtension(extdir); 237 const Extension* extension = LoadExtension(extdir);
238 ASSERT_TRUE(extension); 238 ASSERT_TRUE(extension);
239 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 239 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
240 240
241 // Lazy Background Page still exists, because the extension started a request. 241 // Lazy Background Page still exists, because the extension started a request.
242 ExtensionProcessManager* pm = 242 ExtensionProcessManager* pm =
243 browser()->profile()->GetExtensionProcessManager(); 243 browser()->profile()->GetExtensionProcessManager();
244 ExtensionHost* host = 244 extensions::ExtensionHost* host =
245 pm->GetBackgroundHostForExtension(last_loaded_extension_id_); 245 pm->GetBackgroundHostForExtension(last_loaded_extension_id_);
246 ASSERT_TRUE(host); 246 ASSERT_TRUE(host);
247 247
248 // Abort the request. 248 // Abort the request.
249 bool result = false; 249 bool result = false;
250 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool( 250 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
251 host->render_view_host(), std::wstring(), L"abortRequest()", &result)); 251 host->render_view_host(), std::wstring(), L"abortRequest()", &result));
252 EXPECT_TRUE(result); 252 EXPECT_TRUE(result);
253 page_complete.Wait(); 253 page_complete.Wait();
254 254
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); 365 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_));
366 366
367 // The browser action has a new title. 367 // The browser action has a new title.
368 BrowserActionTestUtil browser_action(browser()); 368 BrowserActionTestUtil browser_action(browser());
369 ASSERT_EQ(1, browser_action.NumberOfBrowserActions()); 369 ASSERT_EQ(1, browser_action.NumberOfBrowserActions());
370 EXPECT_EQ("Success", browser_action.GetTooltip(0)); 370 EXPECT_EQ("Success", browser_action.GetTooltip(0));
371 } 371 }
372 372
373 // TODO: background page with timer. 373 // TODO: background page with timer.
374 // TODO: background page that interacts with popup. 374 // TODO: background page that interacts with popup.
OLDNEW
« no previous file with comments | « chrome/browser/extensions/gpu_browsertest.cc ('k') | chrome/browser/extensions/lazy_background_task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698