| OLD | NEW |
| 1 // Copyright (c) 2011 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 "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 19 #include "webkit/glue/cpp_binding_example.h" | 19 #include "webkit/glue/cpp_binding_example.h" |
| 20 #include "webkit/glue/webkit_glue.h" | 20 #include "webkit/glue/webkit_glue.h" |
| 21 #include "webkit/tools/test_shell/test_shell_test.h" | 21 #include "webkit/tools/test_shell/test_shell_test.h" |
| 22 | 22 |
| 23 using WebKit::WebFrame; | 23 using WebKit::WebFrame; |
| 24 using webkit_glue::CppArgumentList; |
| 25 using webkit_glue::CppBindingExample; |
| 26 using webkit_glue::CppVariant; |
| 24 | 27 |
| 25 namespace { | 28 namespace { |
| 26 | 29 |
| 27 class CppBindingExampleSubObject : public CppBindingExample { | 30 class CppBindingExampleSubObject : public CppBindingExample { |
| 28 public: | 31 public: |
| 29 CppBindingExampleSubObject() { | 32 CppBindingExampleSubObject() { |
| 30 sub_value_.Set("sub!"); | 33 sub_value_.Set("sub!"); |
| 31 BindProperty("sub_value", &sub_value_); | 34 BindProperty("sub_value", &sub_value_); |
| 32 } | 35 } |
| 33 private: | 36 private: |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 287 |
| 285 // Ensures existent methods can be invoked successfully when the fallback method | 288 // Ensures existent methods can be invoked successfully when the fallback method |
| 286 // is used | 289 // is used |
| 287 TEST_F(CppBoundClassWithFallbackMethodTest, | 290 TEST_F(CppBoundClassWithFallbackMethodTest, |
| 288 InvokeExistentMethodsWithFallback) { | 291 InvokeExistentMethodsWithFallback) { |
| 289 std::string js = BuildJSCondition("example.echoValue(34)", "34"); | 292 std::string js = BuildJSCondition("example.echoValue(34)", "34"); |
| 290 CheckJavaScriptSuccess(js); | 293 CheckJavaScriptSuccess(js); |
| 291 } | 294 } |
| 292 | 295 |
| 293 } // namespace | 296 } // namespace |
| OLD | NEW |