| 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 "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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |