| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 : config_state_(NULL) {} | 116 : config_state_(NULL) {} |
| 117 | 117 |
| 118 // static | 118 // static |
| 119 TestGetConfigFunction::TestConfigState* | 119 TestGetConfigFunction::TestConfigState* |
| 120 TestGetConfigFunction::TestConfigState::GetInstance() { | 120 TestGetConfigFunction::TestConfigState::GetInstance() { |
| 121 return Singleton<TestConfigState>::get(); | 121 return Singleton<TestConfigState>::get(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 TestGetConfigFunction::~TestGetConfigFunction() {} | 124 TestGetConfigFunction::~TestGetConfigFunction() {} |
| 125 | 125 |
| 126 bool TestGetConfigFunction::RunImpl() { | 126 bool TestGetConfigFunction::RunSync() { |
| 127 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 127 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 128 | 128 |
| 129 if (!test_config_state->config_state()) { | 129 if (!test_config_state->config_state()) { |
| 130 error_ = kNoTestConfigDataError; | 130 error_ = kNoTestConfigDataError; |
| 131 return false; | 131 return false; |
| 132 } | 132 } |
| 133 | 133 |
| 134 SetResult(test_config_state->config_state()->DeepCopy()); | 134 SetResult(test_config_state->config_state()->DeepCopy()); |
| 135 return true; | 135 return true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} | 138 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} |
| 139 | 139 |
| 140 bool TestWaitForRoundTripFunction::RunImpl() { | 140 bool TestWaitForRoundTripFunction::RunImpl() { |
| 141 scoped_ptr<WaitForRoundTrip::Params> params( | 141 scoped_ptr<WaitForRoundTrip::Params> params( |
| 142 WaitForRoundTrip::Params::Create(*args_)); | 142 WaitForRoundTrip::Params::Create(*args_)); |
| 143 SetResult(new base::StringValue(params->message)); | 143 SetResult(new base::StringValue(params->message)); |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace extensions | 147 } // namespace extensions |
| OLD | NEW |