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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on 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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/api/test/test_api.h" 9 #include "chrome/browser/extensions/api/test/test_api.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 continue; 274 continue;
275 275
276 if (extension != NULL) { 276 if (extension != NULL) {
277 // TODO(yoz): this is misleading; it counts component extensions. 277 // TODO(yoz): this is misleading; it counts component extensions.
278 message_ = base::StringPrintf( 278 message_ = base::StringPrintf(
279 "Expected only one extension to be present. Found %u.", 279 "Expected only one extension to be present. Found %u.",
280 static_cast<unsigned>(service->extensions()->size())); 280 static_cast<unsigned>(service->extensions()->size()));
281 return NULL; 281 return NULL;
282 } 282 }
283 283
284 extension = *it; 284 extension = it->get();
285 } 285 }
286 286
287 if (!extension) { 287 if (!extension) {
288 message_ = "extension pointer is NULL."; 288 message_ = "extension pointer is NULL.";
289 return NULL; 289 return NULL;
290 } 290 }
291 return extension; 291 return extension;
292 } 292 }
293 293
294 bool ExtensionApiTest::StartTestServer() { 294 bool ExtensionApiTest::StartTestServer() {
(...skipping 22 matching lines...) Expand all
317 test_config_->SetInteger(kTestWebSocketPort, 317 test_config_->SetInteger(kTestWebSocketPort,
318 websocket_server_->host_port_pair().port()); 318 websocket_server_->host_port_pair().port());
319 319
320 return true; 320 return true;
321 } 321 }
322 322
323 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { 323 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) {
324 ExtensionBrowserTest::SetUpCommandLine(command_line); 324 ExtensionBrowserTest::SetUpCommandLine(command_line);
325 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); 325 test_data_dir_ = test_data_dir_.AppendASCII("api_test");
326 } 326 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/event_router_forwarder_unittest.cc ('k') | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698