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

Unified Diff: chrome/browser/extensions/page_action_browsertest.cc

Issue 11724002: Move ContentScripts out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/page_action_browsertest.cc
diff --git a/chrome/browser/extensions/page_action_browsertest.cc b/chrome/browser/extensions/page_action_browsertest.cc
index 75a4525c47c7d8c7a2bda59f8fb85c9f349ed559..6d2e6bf5f3449a27b4ff2be4b31275905b0147c4 100644
--- a/chrome/browser/extensions/page_action_browsertest.cc
+++ b/chrome/browser/extensions/page_action_browsertest.cc
@@ -12,7 +12,9 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/api/content_scripts/content_scripts_handler.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/manifest_handler.h"
#include "chrome/test/base/ui_test_utils.h"
namespace extensions {
@@ -29,7 +31,20 @@ const std::string kHashPageAHash = kHashPageA + "#asdf";
const std::string kHashPageB =
"files/extensions/api_test/page_action/hash_change/test_page_B.html";
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionCrash25562) {
+class PageActionBrowserTest : public ExtensionBrowserTest {
+ protected:
+ virtual void SetUpOnMainThread() OVERRIDE {
+ ExtensionBrowserTest::SetUpOnMainThread();
+ (new ContentScriptsHandler)->Register();
+ }
+
+ virtual void CleanUpOnMainThread() OVERRIDE {
+ ManifestHandler::ClearRegistryForTesting();
+ ExtensionBrowserTest::CleanUpOnMainThread();
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, PageActionCrash25562) {
ASSERT_TRUE(test_server()->Start());
CommandLine::ForCurrentProcess()->AppendSwitch(
@@ -49,7 +64,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionCrash25562) {
}
// Tests that we can load page actions in the Omnibox.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) {
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, PageAction) {
ASSERT_TRUE(test_server()->Start());
ASSERT_TRUE(LoadExtension(
@@ -71,7 +86,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) {
}
// Tests that we don't lose the page action icon on in-page navigations.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionInPageNavigation) {
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, PageActionInPageNavigation) {
ASSERT_TRUE(test_server()->Start());
base::FilePath extension_path(test_data_dir_.AppendASCII("api_test")
@@ -96,7 +111,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionInPageNavigation) {
}
// Tests that the location bar forgets about unloaded page actions.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, UnloadPageAction) {
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, UnloadPageAction) {
ASSERT_TRUE(test_server()->Start());
base::FilePath extension_path(
@@ -115,7 +130,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, UnloadPageAction) {
}
// Tests that we can load page actions in the Omnibox.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionRefreshCrash) {
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, PageActionRefreshCrash) {
base::TimeTicks start_time = base::TimeTicks::Now();
ExtensionService* service = extensions::ExtensionSystem::Get(
@@ -171,7 +186,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionRefreshCrash) {
// Tests that tooltips of a page action icon can be specified using UTF8.
// See http://crbug.com/25349.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationPageAction) {
+IN_PROC_BROWSER_TEST_F(PageActionBrowserTest, TitleLocalizationPageAction) {
ASSERT_TRUE(test_server()->Start());
ExtensionService* service = extensions::ExtensionSystem::Get(

Powered by Google App Engine
This is Rietveld 408576698