| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/test/test_api.h" | 5 #include "extensions/browser/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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return true; | 97 return true; |
| 98 } | 98 } |
| 99 | 99 |
| 100 TestSendMessageFunction::~TestSendMessageFunction() {} | 100 TestSendMessageFunction::~TestSendMessageFunction() {} |
| 101 | 101 |
| 102 void TestSendMessageFunction::Reply(const std::string& message) { | 102 void TestSendMessageFunction::Reply(const std::string& message) { |
| 103 SetResult(new base::StringValue(message)); | 103 SetResult(new base::StringValue(message)); |
| 104 SendResponse(true); | 104 SendResponse(true); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void TestSendMessageFunction::ReplyWithError(const std::string& error) { |
| 108 error_ = error; |
| 109 SendResponse(false); |
| 110 } |
| 111 |
| 107 // static | 112 // static |
| 108 void TestGetConfigFunction::set_test_config_state( | 113 void TestGetConfigFunction::set_test_config_state( |
| 109 base::DictionaryValue* value) { | 114 base::DictionaryValue* value) { |
| 110 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 115 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 111 test_config_state->set_config_state(value); | 116 test_config_state->set_config_state(value); |
| 112 } | 117 } |
| 113 | 118 |
| 114 TestGetConfigFunction::TestConfigState::TestConfigState() | 119 TestGetConfigFunction::TestConfigState::TestConfigState() |
| 115 : config_state_(NULL) {} | 120 : config_state_(NULL) {} |
| 116 | 121 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} | 142 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} |
| 138 | 143 |
| 139 bool TestWaitForRoundTripFunction::RunSafe() { | 144 bool TestWaitForRoundTripFunction::RunSafe() { |
| 140 scoped_ptr<WaitForRoundTrip::Params> params( | 145 scoped_ptr<WaitForRoundTrip::Params> params( |
| 141 WaitForRoundTrip::Params::Create(*args_)); | 146 WaitForRoundTrip::Params::Create(*args_)); |
| 142 SetResult(new base::StringValue(params->message)); | 147 SetResult(new base::StringValue(params->message)); |
| 143 return true; | 148 return true; |
| 144 } | 149 } |
| 145 | 150 |
| 146 } // namespace extensions | 151 } // namespace extensions |
| OLD | NEW |