| 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/extension_function_test_utils.h" | 5 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
| 13 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 13 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 using content::WebContents; | 19 using content::WebContents; |
| 20 using extensions::Extension; |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 class TestFunctionDispatcherDelegate | 24 class TestFunctionDispatcherDelegate |
| 24 : public ExtensionFunctionDispatcher::Delegate { | 25 : public ExtensionFunctionDispatcher::Delegate { |
| 25 public: | 26 public: |
| 26 explicit TestFunctionDispatcherDelegate(Browser* browser) : | 27 explicit TestFunctionDispatcherDelegate(Browser* browser) : |
| 27 browser_(browser) {} | 28 browser_(browser) {} |
| 28 virtual ~TestFunctionDispatcherDelegate() {} | 29 virtual ~TestFunctionDispatcherDelegate() {} |
| 29 | 30 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (!response_delegate.HasResponse()) { | 215 if (!response_delegate.HasResponse()) { |
| 215 response_delegate.set_should_post_quit(true); | 216 response_delegate.set_should_post_quit(true); |
| 216 ui_test_utils::RunMessageLoop(); | 217 ui_test_utils::RunMessageLoop(); |
| 217 } | 218 } |
| 218 | 219 |
| 219 EXPECT_TRUE(response_delegate.HasResponse()); | 220 EXPECT_TRUE(response_delegate.HasResponse()); |
| 220 return response_delegate.GetResponse(); | 221 return response_delegate.GetResponse(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace extension_function_test_utils | 224 } // namespace extension_function_test_utils |
| OLD | NEW |