| 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 12 matching lines...) Expand all Loading... |
| 23 // in test set up. | 23 // in test set up. |
| 24 const char kNoTestConfigDataError[] = "Test configuration was not set."; | 24 const char kNoTestConfigDataError[] = "Test configuration was not set."; |
| 25 | 25 |
| 26 const char kNotTestProcessError[] = | 26 const char kNotTestProcessError[] = |
| 27 "The chrome.test namespace is only available in tests."; | 27 "The chrome.test namespace is only available in tests."; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 namespace extensions { | 31 namespace extensions { |
| 32 | 32 |
| 33 namespace Log = core_api::test::Log; | 33 namespace Log = api::test::Log; |
| 34 namespace NotifyFail = core_api::test::NotifyFail; | 34 namespace NotifyFail = api::test::NotifyFail; |
| 35 namespace PassMessage = core_api::test::PassMessage; | 35 namespace PassMessage = api::test::PassMessage; |
| 36 namespace WaitForRoundTrip = core_api::test::WaitForRoundTrip; | 36 namespace WaitForRoundTrip = api::test::WaitForRoundTrip; |
| 37 | 37 |
| 38 TestExtensionFunction::~TestExtensionFunction() {} | 38 TestExtensionFunction::~TestExtensionFunction() {} |
| 39 | 39 |
| 40 bool TestExtensionFunction::RunSync() { | 40 bool TestExtensionFunction::RunSync() { |
| 41 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { | 41 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
| 42 error_ = kNotTestProcessError; | 42 error_ = kNotTestProcessError; |
| 43 return false; | 43 return false; |
| 44 } | 44 } |
| 45 return RunSafe(); | 45 return RunSafe(); |
| 46 } | 46 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |