| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "ipc/ipc_message_utils.h" | 9 #include "ipc/ipc_message_utils.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 void DidDestroy(PP_Instance instance) { | 44 void DidDestroy(PP_Instance instance) { |
| 45 received_instance = instance; | 45 received_instance = instance; |
| 46 } | 46 } |
| 47 | 47 |
| 48 PP_Rect received_position; | 48 PP_Rect received_position; |
| 49 PP_Rect received_clip; | 49 PP_Rect received_clip; |
| 50 // DidChangeView is asynchronous. We wait until the call has completed before | 50 // DidChangeView is asynchronous. We wait until the call has completed before |
| 51 // proceeding on to the next test. | 51 // proceeding on to the next test. |
| 52 base::WaitableEvent did_change_view_called(false, false); | 52 base::WaitableEvent did_change_view_called( |
| 53 base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 54 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 53 void DidChangeView(PP_Instance instance, const PP_Rect* position, | 55 void DidChangeView(PP_Instance instance, const PP_Rect* position, |
| 54 const PP_Rect* clip) { | 56 const PP_Rect* clip) { |
| 55 received_instance = instance; | 57 received_instance = instance; |
| 56 received_position = *position; | 58 received_position = *position; |
| 57 received_clip = *clip; | 59 received_clip = *clip; |
| 58 did_change_view_called.Signal(); | 60 did_change_view_called.Signal(); |
| 59 } | 61 } |
| 60 | 62 |
| 61 PP_Bool received_has_focus; | 63 PP_Bool received_has_focus; |
| 62 base::WaitableEvent did_change_focus_called(false, false); | 64 base::WaitableEvent did_change_focus_called( |
| 65 base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 66 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 63 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { | 67 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { |
| 64 received_instance = instance; | 68 received_instance = instance; |
| 65 received_has_focus = has_focus; | 69 received_has_focus = has_focus; |
| 66 did_change_focus_called.Signal(); | 70 did_change_focus_called.Signal(); |
| 67 } | 71 } |
| 68 | 72 |
| 69 PP_Bool HandleDocumentLoad(PP_Instance instance, PP_Resource url_loader) { | 73 PP_Bool HandleDocumentLoad(PP_Instance instance, PP_Resource url_loader) { |
| 70 // This one requires use of the PPB_URLLoader proxy and PPB_Core, plus a | 74 // This one requires use of the PPB_URLLoader proxy and PPB_Core, plus a |
| 71 // resource tracker for the url_loader resource. | 75 // resource tracker for the url_loader resource. |
| 72 // TODO(dmichael): Mock those out and test this function. | 76 // TODO(dmichael): Mock those out and test this function. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // TODO(dmichael): Need to mock out a resource Tracker to be able to test | 195 // TODO(dmichael): Need to mock out a resource Tracker to be able to test |
| 192 // HandleResourceLoad. It also requires | 196 // HandleResourceLoad. It also requires |
| 193 // PPB_Core.AddRefResource and for PPB_URLLoader to be | 197 // PPB_Core.AddRefResource and for PPB_URLLoader to be |
| 194 // registered. | 198 // registered. |
| 195 | 199 |
| 196 host().resource_tracker().DidDeleteInstance(expected_instance); | 200 host().resource_tracker().DidDeleteInstance(expected_instance); |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace proxy | 203 } // namespace proxy |
| 200 } // namespace ppapi | 204 } // namespace ppapi |
| OLD | NEW |