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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 content::Source<Profile>(source).ptr() != profile_restriction_) { | 75 content::Source<Profile>(source).ptr() != profile_restriction_) { |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 switch (type) { | 79 switch (type) { |
80 case chrome::NOTIFICATION_EXTENSION_TEST_PASSED: | 80 case chrome::NOTIFICATION_EXTENSION_TEST_PASSED: |
81 VLOG(1) << "Got EXTENSION_TEST_PASSED notification."; | 81 VLOG(1) << "Got EXTENSION_TEST_PASSED notification."; |
82 results_.push_back(true); | 82 results_.push_back(true); |
83 messages_.push_back(std::string()); | 83 messages_.push_back(std::string()); |
84 if (waiting_) | 84 if (waiting_) |
85 MessageLoopForUI::current()->Quit(); | 85 base::MessageLoopForUI::current()->Quit(); |
86 break; | 86 break; |
87 | 87 |
88 case chrome::NOTIFICATION_EXTENSION_TEST_FAILED: | 88 case chrome::NOTIFICATION_EXTENSION_TEST_FAILED: |
89 VLOG(1) << "Got EXTENSION_TEST_FAILED notification."; | 89 VLOG(1) << "Got EXTENSION_TEST_FAILED notification."; |
90 results_.push_back(false); | 90 results_.push_back(false); |
91 messages_.push_back(*(content::Details<std::string>(details).ptr())); | 91 messages_.push_back(*(content::Details<std::string>(details).ptr())); |
92 if (waiting_) | 92 if (waiting_) |
93 MessageLoopForUI::current()->Quit(); | 93 base::MessageLoopForUI::current()->Quit(); |
94 break; | 94 break; |
95 | 95 |
96 default: | 96 default: |
97 NOTREACHED(); | 97 NOTREACHED(); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 void ExtensionApiTest::SetUpInProcessBrowserTestFixture() { | 101 void ExtensionApiTest::SetUpInProcessBrowserTestFixture() { |
102 DCHECK(!test_config_.get()) << "Previous test did not clear config state."; | 102 DCHECK(!test_config_.get()) << "Previous test did not clear config state."; |
103 test_config_.reset(new DictionaryValue()); | 103 test_config_.reset(new DictionaryValue()); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 test_config_->SetInteger(kTestWebSocketPort, | 320 test_config_->SetInteger(kTestWebSocketPort, |
321 websocket_server_->host_port_pair().port()); | 321 websocket_server_->host_port_pair().port()); |
322 | 322 |
323 return true; | 323 return true; |
324 } | 324 } |
325 | 325 |
326 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { | 326 void ExtensionApiTest::SetUpCommandLine(CommandLine* command_line) { |
327 ExtensionBrowserTest::SetUpCommandLine(command_line); | 327 ExtensionBrowserTest::SetUpCommandLine(command_line); |
328 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); | 328 test_data_dir_ = test_data_dir_.AppendASCII("api_test"); |
329 } | 329 } |
OLD | NEW |