| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/extensions/extensions_service.h" | 8 #include "chrome/browser/extensions/extensions_service.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 11 #include "chrome/test/ui_test_utils.h" | 12 #include "chrome/test/ui_test_utils.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 static const int kTimeoutMs = 60 * 1000; // 1 minute | 15 static const int kTimeoutMs = 60 * 1000; // 1 minute |
| 15 }; | 16 }; |
| 16 | 17 |
| 17 ExtensionApiTest::ResultCatcher::ResultCatcher() { | 18 ExtensionApiTest::ResultCatcher::ResultCatcher() { |
| 18 registrar_.Add(this, NotificationType::EXTENSION_TEST_PASSED, | 19 registrar_.Add(this, NotificationType::EXTENSION_TEST_PASSED, |
| 19 NotificationService::AllSources()); | 20 NotificationService::AllSources()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (!extension) { | 97 if (!extension) { |
| 97 message_ = "extension pointer is NULL."; | 98 message_ = "extension pointer is NULL."; |
| 98 return NULL; | 99 return NULL; |
| 99 } | 100 } |
| 100 return extension; | 101 return extension; |
| 101 } | 102 } |
| 102 | 103 |
| 103 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 104 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
| 104 ExtensionBrowserTest::SetUpCommandLine(command_line); | 105 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 105 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 106 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
| 107 |
| 108 // Needed for metrics extension API tests. |
| 109 command_line->AppendSwitch(switches::kEnableMetricsExtensionApi); |
| 106 } | 110 } |
| OLD | NEW |