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 // Tests for CppBoundClass, in conjunction with CppBindingExample. Binds | 5 // Tests for CppBoundClass, in conjunction with CppBindingExample. Binds |
6 // a CppBindingExample class into JavaScript in a custom test shell and tests | 6 // a CppBindingExample class into JavaScript in a custom test shell and tests |
7 // the binding from the outside by loading JS into the shell. | 7 // the binding from the outside by loading JS into the shell. |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" | 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo
rmSupport.h" | |
28 #include "webkit/glue/cpp_binding_example.h" | 28 #include "webkit/glue/cpp_binding_example.h" |
29 #include "webkit/glue/webkit_glue.h" | 29 #include "webkit/glue/webkit_glue.h" |
30 #include "webkit/user_agent/user_agent.h" | 30 #include "webkit/user_agent/user_agent.h" |
31 #include "webkit/user_agent/user_agent_util.h" | 31 #include "webkit/user_agent/user_agent_util.h" |
32 | 32 |
33 using WebKit::WebFrame; | 33 using WebKit::WebFrame; |
34 using WebKit::WebView; | 34 using WebKit::WebView; |
35 using webkit_glue::CppArgumentList; | 35 using webkit_glue::CppArgumentList; |
36 using webkit_glue::CppBindingExample; | 36 using webkit_glue::CppBindingExample; |
37 using webkit_glue::CppVariant; | 37 using webkit_glue::CppVariant; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 // Ensures existent methods can be invoked successfully when the fallback method | 298 // Ensures existent methods can be invoked successfully when the fallback method |
299 // is used | 299 // is used |
300 TEST_F(CppBoundClassWithFallbackMethodTest, | 300 TEST_F(CppBoundClassWithFallbackMethodTest, |
301 InvokeExistentMethodsWithFallback) { | 301 InvokeExistentMethodsWithFallback) { |
302 std::string js = BuildJSCondition("example.echoValue(34)", "34"); | 302 std::string js = BuildJSCondition("example.echoValue(34)", "34"); |
303 CheckJavaScriptSuccess(js); | 303 CheckJavaScriptSuccess(js); |
304 } | 304 } |
305 | 305 |
306 } // namespace | 306 } // namespace |
OLD | NEW |