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/files/file_path.h" | 8 #include "base/files/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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ExtensionBuilder() | 112 ExtensionBuilder() |
113 .SetPath(root.AppendASCII("f3")) | 113 .SetPath(root.AppendASCII("f3")) |
114 .SetManifest(DictionaryBuilder() | 114 .SetManifest(DictionaryBuilder() |
115 .Set("name", "ex3") | 115 .Set("name", "ex3") |
116 .Set("version", "1") | 116 .Set("version", "1") |
117 .Set("manifest_version", 2) | 117 .Set("manifest_version", 2) |
118 .Set("permissions", ListBuilder() | 118 .Set("permissions", ListBuilder() |
119 .Append("activeTab"))) | 119 .Append("activeTab"))) |
120 .Build(); | 120 .Build(); |
121 | 121 |
122 extension_service_->AddExtension(extension1); | 122 extension_service_->AddExtension(extension1.get()); |
123 extension_service_->AddExtension(extension2); | 123 extension_service_->AddExtension(extension2.get()); |
124 extension_service_->AddExtension(extension3); | 124 extension_service_->AddExtension(extension3.get()); |
125 | 125 |
126 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); | 126 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); |
127 | 127 |
128 NavigateAndCommit(GURL("http://www.google.com")); | 128 NavigateAndCommit(GURL("http://www.google.com")); |
129 | 129 |
130 // Running a script on the tab causes the bubble to be visible. | 130 // Running a script on the tab causes the bubble to be visible. |
131 TabHelper::ScriptExecutionObserver::ExecutingScriptsMap executing_scripts; | 131 TabHelper::ScriptExecutionObserver::ExecutingScriptsMap executing_scripts; |
132 executing_scripts[extension1->id()].insert("script1"); | 132 executing_scripts[extension1->id()].insert("script1"); |
133 script_bubble_controller_->OnScriptsExecuted( | 133 script_bubble_controller_->OnScriptsExecuted( |
134 web_contents(), | 134 web_contents(), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 web_contents(), executing_scripts, 0, GURL()); | 181 web_contents(), executing_scripts, 0, GURL()); |
182 EXPECT_EQ(3u, script_bubble_controller_->extensions_running_scripts().size()); | 182 EXPECT_EQ(3u, script_bubble_controller_->extensions_running_scripts().size()); |
183 | 183 |
184 // Navigating away resets the badge. | 184 // Navigating away resets the badge. |
185 NavigateAndCommit(GURL("http://www.google.com")); | 185 NavigateAndCommit(GURL("http://www.google.com")); |
186 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); | 186 EXPECT_EQ(0u, script_bubble_controller_->extensions_running_scripts().size()); |
187 }; | 187 }; |
188 | 188 |
189 } // namespace | 189 } // namespace |
190 } // namespace extensions | 190 } // namespace extensions |
OLD | NEW |