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

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

Issue 11411308: Enable script bubble by default on all but mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Everything passes Created 8 years 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
« no previous file with comments | « chrome/browser/extensions/script_bubble_controller.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/script_bubble_controller_unittest.cc
diff --git a/chrome/browser/extensions/script_bubble_controller_unittest.cc b/chrome/browser/extensions/script_bubble_controller_unittest.cc
index 394dd20c0fa246f9005c01fb9a918bd6179e1d2c..dc1c913241783b731c73a413a7a19bacb5800532 100644
--- a/chrome/browser/extensions/script_bubble_controller_unittest.cc
+++ b/chrome/browser/extensions/script_bubble_controller_unittest.cc
@@ -46,7 +46,6 @@ class ScriptBubbleControllerTest : public ChromeRenderViewHostTestHarness {
extension_service_ = static_cast<TestExtensionSystem*>(
ExtensionSystem::Get(profile))->CreateExtensionService(
&command_line, FilePath(), false);
- extension_service_->component_loader()->AddScriptBubble();
extension_service_->Init();
TabHelper::CreateForWebContents(web_contents());
@@ -106,17 +105,9 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
extension_service_->AddExtension(extension2);
extension_service_->AddExtension(extension3);
- const Extension* script_bubble =
- extension_service_->component_loader()->GetScriptBubble();
- ExtensionAction* script_bubble_action =
- ExtensionActionManager::Get(profile())->GetPageAction(*script_bubble);
- ASSERT_TRUE(script_bubble_action);
+ EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size());
- // By default, the bubble should be invisible.
NavigateAndCommit(GURL("http://www.google.com"));
- EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id()));
- EXPECT_EQ("", script_bubble_action->GetBadgeText(tab_id()));
- EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size());
// Running a script on the tab causes the bubble to be visible.
TabHelper::ScriptExecutionObserver::ExecutingScriptsMap executing_scripts;
@@ -126,8 +117,6 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
executing_scripts,
web_contents()->GetController().GetActiveEntry()->GetPageID(),
web_contents()->GetController().GetActiveEntry()->GetURL());
- // TODO(finnur): Figure out visibility test.
- // EXPECT_TRUE(script_bubble_action->GetIsVisible(tab_id()));
EXPECT_EQ(1u, script_bubble_controller_->extensions_running_scripts().size());
std::set<std::string> extension_ids;
extension_ids.insert(extension1->id());
@@ -143,7 +132,6 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
executing_scripts,
web_contents()->GetController().GetActiveEntry()->GetPageID(),
web_contents()->GetController().GetActiveEntry()->GetURL());
- // EXPECT_TRUE(script_bubble_action->GetIsVisible(tab_id()));
EXPECT_EQ(2u, script_bubble_controller_->extensions_running_scripts().size());
extension_ids.insert(extension2->id());
EXPECT_TRUE(extension_ids ==
@@ -158,7 +146,6 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
executing_scripts,
web_contents()->GetController().GetActiveEntry()->GetPageID(),
web_contents()->GetController().GetActiveEntry()->GetURL());
- // EXPECT_TRUE(script_bubble_action->GetIsVisible(tab_id()));
EXPECT_EQ(2u, script_bubble_controller_->extensions_running_scripts().size());
// Running tabs.executeScript from an already-seen extension does not affect
@@ -167,7 +154,6 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
executing_scripts[extension1->id()] = std::set<std::string>();
script_bubble_controller_->OnScriptsExecuted(
web_contents(), executing_scripts, 0, GURL());
- // EXPECT_TRUE(script_bubble_action->GetIsVisible(tab_id()));
EXPECT_EQ(2u, script_bubble_controller_->extensions_running_scripts().size());
// Running tabs.executeScript from a new extension increments the count.
@@ -175,14 +161,11 @@ TEST_F(ScriptBubbleControllerTest, Basics) {
executing_scripts[extension3->id()] = std::set<std::string>();
script_bubble_controller_->OnScriptsExecuted(
web_contents(), executing_scripts, 0, GURL());
- // EXPECT_TRUE(script_bubble_action->GetIsVisible(tab_id()));
- extension_ids.insert(extension3->id());
EXPECT_EQ(3u, script_bubble_controller_->extensions_running_scripts().size());
// Navigating away resets the badge.
NavigateAndCommit(GURL("http://www.google.com"));
- EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id()));
- EXPECT_EQ("", script_bubble_action->GetBadgeText(tab_id()));
+ EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size());
};
} // namespace
« no previous file with comments | « chrome/browser/extensions/script_bubble_controller.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698