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

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

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
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 <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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/script_badge_controller_unittest.cc ('k') | chrome/browser/extensions/startup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698