| 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/api/test/test_api.h" | 5 #include "chrome/browser/extensions/api/test/test_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 SendResponse(RunImpl()); | 49 SendResponse(RunImpl()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 TestNotifyPassFunction::~TestNotifyPassFunction() {} | 52 TestNotifyPassFunction::~TestNotifyPassFunction() {} |
| 53 | 53 |
| 54 bool TestNotifyPassFunction::RunImpl() { | 54 bool TestNotifyPassFunction::RunImpl() { |
| 55 content::NotificationService::current()->Notify( | 55 content::NotificationService::current()->Notify( |
| 56 chrome::NOTIFICATION_EXTENSION_TEST_PASSED, | 56 chrome::NOTIFICATION_EXTENSION_TEST_PASSED, |
| 57 content::Source<Profile>(dispatcher()->profile()), | 57 content::Source<content::BrowserContext>(dispatcher()->browser_context()), |
| 58 content::NotificationService::NoDetails()); | 58 content::NotificationService::NoDetails()); |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 TestNotifyFailFunction::~TestNotifyFailFunction() {} | 62 TestNotifyFailFunction::~TestNotifyFailFunction() {} |
| 63 | 63 |
| 64 bool TestNotifyFailFunction::RunImpl() { | 64 bool TestNotifyFailFunction::RunImpl() { |
| 65 scoped_ptr<NotifyFail::Params> params(NotifyFail::Params::Create(*args_)); | 65 scoped_ptr<NotifyFail::Params> params(NotifyFail::Params::Create(*args_)); |
| 66 EXTENSION_FUNCTION_VALIDATE(params.get()); | 66 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 67 content::NotificationService::current()->Notify( | 67 content::NotificationService::current()->Notify( |
| 68 chrome::NOTIFICATION_EXTENSION_TEST_FAILED, | 68 chrome::NOTIFICATION_EXTENSION_TEST_FAILED, |
| 69 content::Source<Profile>(dispatcher()->profile()), | 69 content::Source<content::BrowserContext>(dispatcher()->browser_context()), |
| 70 content::Details<std::string>(¶ms->message)); | 70 content::Details<std::string>(¶ms->message)); |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 TestLogFunction::~TestLogFunction() {} | 74 TestLogFunction::~TestLogFunction() {} |
| 75 | 75 |
| 76 bool TestLogFunction::RunImpl() { | 76 bool TestLogFunction::RunImpl() { |
| 77 scoped_ptr<Log::Params> params(Log::Params::Create(*args_)); | 77 scoped_ptr<Log::Params> params(Log::Params::Create(*args_)); |
| 78 EXTENSION_FUNCTION_VALIDATE(params.get()); | 78 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 79 VLOG(1) << params->message; | 79 VLOG(1) << params->message; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (!test_config_state->config_state()) { | 144 if (!test_config_state->config_state()) { |
| 145 error_ = kNoTestConfigDataError; | 145 error_ = kNoTestConfigDataError; |
| 146 return false; | 146 return false; |
| 147 } | 147 } |
| 148 | 148 |
| 149 SetResult(test_config_state->config_state()->DeepCopy()); | 149 SetResult(test_config_state->config_state()->DeepCopy()); |
| 150 return true; | 150 return true; |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace extensions | 153 } // namespace extensions |
| OLD | NEW |