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/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Test that exactly one extension is loaded, and return it. | 253 // Test that exactly one extension is loaded, and return it. |
254 const extensions::Extension* ExtensionApiTest::GetSingleLoadedExtension() { | 254 const extensions::Extension* ExtensionApiTest::GetSingleLoadedExtension() { |
255 ExtensionService* service = extensions::ExtensionSystem::Get( | 255 ExtensionService* service = extensions::ExtensionSystem::Get( |
256 browser()->profile())->extension_service(); | 256 browser()->profile())->extension_service(); |
257 | 257 |
258 const extensions::Extension* extension = NULL; | 258 const extensions::Extension* extension = NULL; |
259 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 259 for (ExtensionSet::const_iterator it = service->extensions()->begin(); |
260 it != service->extensions()->end(); ++it) { | 260 it != service->extensions()->end(); ++it) { |
261 // Ignore any component extensions. They are automatically loaded into all | 261 // Ignore any component extensions. They are automatically loaded into all |
262 // profiles and aren't the extension we're looking for here. | 262 // profiles and aren't the extension we're looking for here. |
263 if ((*it)->location() == extensions::Extension::COMPONENT) | 263 if ((*it)->location() == extensions::Manifest::COMPONENT) |
264 continue; | 264 continue; |
265 | 265 |
266 if (extension != NULL) { | 266 if (extension != NULL) { |
267 // TODO(yoz): this is misleading; it counts component extensions. | 267 // TODO(yoz): this is misleading; it counts component extensions. |
268 message_ = base::StringPrintf( | 268 message_ = base::StringPrintf( |
269 "Expected only one extension to be present. Found %u.", | 269 "Expected only one extension to be present. Found %u.", |
270 static_cast<unsigned>(service->extensions()->size())); | 270 static_cast<unsigned>(service->extensions()->size())); |
271 return NULL; | 271 return NULL; |
272 } | 272 } |
273 | 273 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 test_config_->SetInteger(kTestWebSocketPort, | 306 test_config_->SetInteger(kTestWebSocketPort, |
307 websocket_server_->host_port_pair().port()); | 307 websocket_server_->host_port_pair().port()); |
308 | 308 |
309 return true; | 309 return true; |
310 } | 310 } |
311 | 311 |
312 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 312 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
313 ExtensionBrowserTest::SetUpCommandLine(command_line); | 313 ExtensionBrowserTest::SetUpCommandLine(command_line); |
314 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 314 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
315 } | 315 } |
OLD | NEW |