OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/test/plugin/plugin_get_javascript_url_test.h" | 5 #include "content/test/plugin/plugin_get_javascript_url_test.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 // url for "self". | 10 // url for "self". |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return; | 82 return; |
83 } | 83 } |
84 | 84 |
85 std::string script = "javascript:window.location"; | 85 std::string script = "javascript:window.location"; |
86 NPString script_string; | 86 NPString script_string; |
87 script_string.UTF8Characters = script.c_str(); | 87 script_string.UTF8Characters = script.c_str(); |
88 script_string.UTF8Length = static_cast<unsigned int>(script.length()); | 88 script_string.UTF8Length = static_cast<unsigned int>(script.length()); |
89 NPVariant result_var; | 89 NPVariant result_var; |
90 | 90 |
91 this_instance->npn_evaluate_context_ = true; | 91 this_instance->npn_evaluate_context_ = true; |
92 NPError result = this_instance->HostFunctions()->evaluate( | 92 this_instance->HostFunctions()->evaluate( |
93 this_instance->id(), window_obj, &script_string, &result_var); | 93 this_instance->id(), window_obj, &script_string, &result_var); |
94 this_instance->npn_evaluate_context_ = false; | 94 this_instance->npn_evaluate_context_ = false; |
95 } | 95 } |
96 #endif | 96 #endif |
97 | 97 |
98 NPError ExecuteGetJavascriptUrlTest::NewStream(NPMIMEType type, | 98 NPError ExecuteGetJavascriptUrlTest::NewStream(NPMIMEType type, |
99 NPStream* stream, | 99 NPStream* stream, |
100 NPBool seekable, | 100 NPBool seekable, |
101 uint16* stype) { | 101 uint16* stype) { |
102 if (stream == NULL) { | 102 if (stream == NULL) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 SetError("Failed to obtain window location."); | 211 SetError("Failed to obtain window location."); |
212 SignalTestCompleted(); | 212 SignalTestCompleted(); |
213 break; | 213 break; |
214 default: | 214 default: |
215 SetError("Unexpected NewStream callback"); | 215 SetError("Unexpected NewStream callback"); |
216 break; | 216 break; |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 } // namespace NPAPIClient | 220 } // namespace NPAPIClient |
OLD | NEW |