OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 scoped_refptr<const Extension> extension2 = | 87 scoped_refptr<const Extension> extension2 = |
88 ExtensionBuilder() | 88 ExtensionBuilder() |
89 .SetPath(root.AppendASCII("f2")) | 89 .SetPath(root.AppendASCII("f2")) |
90 .SetManifest(DictionaryBuilder() | 90 .SetManifest(DictionaryBuilder() |
91 .Set("name", "ex2") | 91 .Set("name", "ex2") |
92 .Set("version", "1") | 92 .Set("version", "1") |
93 .Set("manifest_version", 2)) | 93 .Set("manifest_version", 2)) |
94 .Build(); | 94 .Build(); |
95 | 95 |
96 extension_service_->AddExtension(extension1); | 96 extension_service_->AddExtension(extension1.get()); |
97 extension_service_->AddExtension(extension2); | 97 extension_service_->AddExtension(extension2.get()); |
98 | 98 |
99 const Extension* script_bubble = | 99 const Extension* script_bubble = |
100 extension_service_->component_loader()->GetScriptBubble(); | 100 extension_service_->component_loader()->GetScriptBubble(); |
101 ExtensionAction* script_bubble_action = | 101 ExtensionAction* script_bubble_action = |
102 ExtensionActionManager::Get(profile())->GetPageAction(*script_bubble); | 102 ExtensionActionManager::Get(profile())->GetPageAction(*script_bubble); |
103 ASSERT_TRUE(script_bubble_action); | 103 ASSERT_TRUE(script_bubble_action); |
104 | 104 |
105 // By default, the bubble should be invisible. | 105 // By default, the bubble should be invisible. |
106 NavigateAndCommit(GURL("http://www.google.com")); | 106 NavigateAndCommit(GURL("http://www.google.com")); |
107 EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id())); | 107 EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id())); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // Navigating away resets the badge. | 154 // Navigating away resets the badge. |
155 NavigateAndCommit(GURL("http://www.google.com")); | 155 NavigateAndCommit(GURL("http://www.google.com")); |
156 EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id())); | 156 EXPECT_FALSE(script_bubble_action->GetIsVisible(tab_id())); |
157 EXPECT_EQ("", script_bubble_action->GetBadgeText(tab_id())); | 157 EXPECT_EQ("", script_bubble_action->GetBadgeText(tab_id())); |
158 EXPECT_EQ(GURL(), script_bubble_action->GetPopupUrl(tab_id())); | 158 EXPECT_EQ(GURL(), script_bubble_action->GetPopupUrl(tab_id())); |
159 }; | 159 }; |
160 | 160 |
161 } // namespace | 161 } // namespace |
162 } // namespace extensions | 162 } // namespace extensions |
OLD | NEW |