| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h" | 5 #include "webkit/plugins/npapi/test/plugin_get_javascript_url_test.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" |
| 8 | 9 |
| 9 // url for "self". | 10 // url for "self". |
| 10 #define SELF_URL "javascript:window.location+\"\"" | 11 #define SELF_URL "javascript:window.location+\"\"" |
| 11 // The identifier for the self url stream. | 12 // The identifier for the self url stream. |
| 12 #define SELF_URL_STREAM_ID 1 | 13 #define SELF_URL_STREAM_ID 1 |
| 13 | 14 |
| 14 // The identifier for the fetched url stream. | 15 // The identifier for the fetched url stream. |
| 15 #define FETCHED_URL_STREAM_ID 2 | 16 #define FETCHED_URL_STREAM_ID 2 |
| 16 | 17 |
| 17 // The maximum chunk size of stream data. | 18 // The maximum chunk size of stream data. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 61 |
| 61 return NPERR_NO_ERROR; | 62 return NPERR_NO_ERROR; |
| 62 } | 63 } |
| 63 | 64 |
| 64 #ifdef OS_WIN | 65 #ifdef OS_WIN |
| 65 void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc( | 66 void CALLBACK ExecuteGetJavascriptUrlTest::TimerProc( |
| 66 HWND window, UINT message, UINT timer_id, unsigned long elapsed_time) { | 67 HWND window, UINT message, UINT timer_id, unsigned long elapsed_time) { |
| 67 ExecuteGetJavascriptUrlTest* this_instance = | 68 ExecuteGetJavascriptUrlTest* this_instance = |
| 68 reinterpret_cast<ExecuteGetJavascriptUrlTest*> | 69 reinterpret_cast<ExecuteGetJavascriptUrlTest*> |
| 69 (::GetProp(window, L"Plugin_Instance")); | 70 (::GetProp(window, L"Plugin_Instance")); |
| 71 CHECK(this_instance); |
| 70 | 72 |
| 71 ::RemoveProp(window, L"Plugin_Instance"); | 73 ::RemoveProp(window, L"Plugin_Instance"); |
| 72 | 74 |
| 73 NPObject *window_obj = NULL; | 75 NPObject *window_obj = NULL; |
| 74 this_instance->HostFunctions()->getvalue(this_instance->id(), | 76 this_instance->HostFunctions()->getvalue(this_instance->id(), |
| 75 NPNVWindowNPObject, | 77 NPNVWindowNPObject, |
| 76 &window_obj); | 78 &window_obj); |
| 77 if (!window_obj) { | 79 if (!window_obj) { |
| 78 this_instance->SetError("Failed to get NPObject for plugin instance2"); | 80 this_instance->SetError("Failed to get NPObject for plugin instance2"); |
| 79 this_instance->SignalTestCompleted(); | 81 this_instance->SignalTestCompleted(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 SetError("Failed to obtain window location."); | 211 SetError("Failed to obtain window location."); |
| 210 SignalTestCompleted(); | 212 SignalTestCompleted(); |
| 211 break; | 213 break; |
| 212 default: | 214 default: |
| 213 SetError("Unexpected NewStream callback"); | 215 SetError("Unexpected NewStream callback"); |
| 214 break; | 216 break; |
| 215 } | 217 } |
| 216 } | 218 } |
| 217 | 219 |
| 218 } // namespace NPAPIClient | 220 } // namespace NPAPIClient |
| OLD | NEW |