| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 104 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 105 test_config_state->set_config_state(value); | 105 test_config_state->set_config_state(value); |
| 106 } | 106 } |
| 107 | 107 |
| 108 TestGetConfigFunction::TestConfigState::TestConfigState() | 108 TestGetConfigFunction::TestConfigState::TestConfigState() |
| 109 : config_state_(NULL) {} | 109 : config_state_(NULL) {} |
| 110 | 110 |
| 111 // static | 111 // static |
| 112 TestGetConfigFunction::TestConfigState* | 112 TestGetConfigFunction::TestConfigState* |
| 113 TestGetConfigFunction::TestConfigState::GetInstance() { | 113 TestGetConfigFunction::TestConfigState::GetInstance() { |
| 114 return Singleton<TestConfigState>::get(); | 114 return base::Singleton<TestConfigState>::get(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 TestGetConfigFunction::~TestGetConfigFunction() {} | 117 TestGetConfigFunction::~TestGetConfigFunction() {} |
| 118 | 118 |
| 119 bool TestGetConfigFunction::RunSafe() { | 119 bool TestGetConfigFunction::RunSafe() { |
| 120 TestConfigState* test_config_state = TestConfigState::GetInstance(); | 120 TestConfigState* test_config_state = TestConfigState::GetInstance(); |
| 121 | 121 |
| 122 if (!test_config_state->config_state()) { | 122 if (!test_config_state->config_state()) { |
| 123 error_ = kNoTestConfigDataError; | 123 error_ = kNoTestConfigDataError; |
| 124 return false; | 124 return false; |
| 125 } | 125 } |
| 126 | 126 |
| 127 SetResult(test_config_state->config_state()->DeepCopy()); | 127 SetResult(test_config_state->config_state()->DeepCopy()); |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| 130 | 130 |
| 131 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} | 131 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} |
| 132 | 132 |
| 133 bool TestWaitForRoundTripFunction::RunSafe() { | 133 bool TestWaitForRoundTripFunction::RunSafe() { |
| 134 scoped_ptr<WaitForRoundTrip::Params> params( | 134 scoped_ptr<WaitForRoundTrip::Params> params( |
| 135 WaitForRoundTrip::Params::Create(*args_)); | 135 WaitForRoundTrip::Params::Create(*args_)); |
| 136 SetResult(new base::StringValue(params->message)); | 136 SetResult(new base::StringValue(params->message)); |
| 137 return true; | 137 return true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace extensions | 140 } // namespace extensions |
| OLD | NEW |