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/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/api/test/test_api.h" | 10 #include "chrome/browser/extensions/api/test/test_api.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 ExtensionApiTest::ResultCatcher::~ResultCatcher() { | 44 ExtensionApiTest::ResultCatcher::~ResultCatcher() { |
45 } | 45 } |
46 | 46 |
47 bool ExtensionApiTest::ResultCatcher::GetNextResult() { | 47 bool ExtensionApiTest::ResultCatcher::GetNextResult() { |
48 // Depending on the tests, multiple results can come in from a single call | 48 // Depending on the tests, multiple results can come in from a single call |
49 // to RunMessageLoop(), so we maintain a queue of results and just pull them | 49 // to RunMessageLoop(), so we maintain a queue of results and just pull them |
50 // off as the test calls this, going to the run loop only when the queue is | 50 // off as the test calls this, going to the run loop only when the queue is |
51 // empty. | 51 // empty. |
52 if (results_.empty()) { | 52 if (results_.empty()) { |
53 waiting_ = true; | 53 waiting_ = true; |
54 ui_test_utils::RunMessageLoop(); | 54 content::RunMessageLoop(); |
55 waiting_ = false; | 55 waiting_ = false; |
56 } | 56 } |
57 | 57 |
58 if (!results_.empty()) { | 58 if (!results_.empty()) { |
59 bool ret = results_.front(); | 59 bool ret = results_.front(); |
60 results_.pop_front(); | 60 results_.pop_front(); |
61 message_ = messages_.front(); | 61 message_ = messages_.front(); |
62 messages_.pop_front(); | 62 messages_.pop_front(); |
63 return ret; | 63 return ret; |
64 } | 64 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 290 |
291 void PlatformAppApiTest::SetUpCommandLine(CommandLine* command_line) { | 291 void PlatformAppApiTest::SetUpCommandLine(CommandLine* command_line) { |
292 ExtensionApiTest::SetUpCommandLine(command_line); | 292 ExtensionApiTest::SetUpCommandLine(command_line); |
293 | 293 |
294 // If someone is using this class, we're going to insist on management of the | 294 // If someone is using this class, we're going to insist on management of the |
295 // relevant flags. If these flags are already set, die. | 295 // relevant flags. If these flags are already set, die. |
296 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); | 296 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); |
297 | 297 |
298 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 298 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
299 } | 299 } |
OLD | NEW |