| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "native_client/src/include/nacl_macros.h" | 9 #include "native_client/src/include/nacl_macros.h" |
| 10 #include "native_client/src/shared/platform/nacl_check.h" | 10 #include "native_client/src/shared/platform/nacl_check.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 CHECK(instance == pp_instance()); | 38 CHECK(instance == pp_instance()); |
| 39 NACL_NOTREACHED(); | 39 NACL_NOTREACHED(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void DidChangeView(PP_Instance instance, PP_Resource view) { | 42 void DidChangeView(PP_Instance instance, PP_Resource view) { |
| 43 printf("--- PPP_Instance::DidChangeView\n"); | 43 printf("--- PPP_Instance::DidChangeView\n"); |
| 44 EXPECT(instance == pp_instance()); | 44 EXPECT(instance == pp_instance()); |
| 45 | 45 |
| 46 PP_Rect clip; | 46 PP_Rect clip; |
| 47 PPBView()->GetClipRect(view, &clip); | 47 PPBView()->GetClipRect(view, &clip); |
| 48 EXPECT(clip.point.x == 0 && clip.point.y == 0); | 48 EXPECT(clip.point.x == 0 && clip.point.y == -1); |
| 49 | 49 |
| 50 // These are based on embed dimensions. | 50 // These are based on embed dimensions. |
| 51 PP_Rect position; | 51 PP_Rect position; |
| 52 PPBView()->GetRect(view, &position); | 52 PPBView()->GetRect(view, &position); |
| 53 fprintf(stderr, "clip.size.height: %d\n", clip.size.height); |
| 53 EXPECT(position.size.width == 15 && clip.size.width == 15); | 54 EXPECT(position.size.width == 15 && clip.size.width == 15); |
| 54 EXPECT(position.size.height == 20 && clip.size.height == 20); | 55 EXPECT(position.size.height == 20 && clip.size.height == 23); |
| 55 | 56 |
| 56 TEST_PASSED; | 57 TEST_PASSED; |
| 57 } | 58 } |
| 58 | 59 |
| 59 void DidChangeFocus(PP_Instance instance, | 60 void DidChangeFocus(PP_Instance instance, |
| 60 PP_Bool has_focus) { | 61 PP_Bool has_focus) { |
| 61 printf("--- PPP_Instance::DidChangeFocus has_focus=%d\n", has_focus); | 62 printf("--- PPP_Instance::DidChangeFocus has_focus=%d\n", has_focus); |
| 62 // There should be no focus on load, so this will trigger when we gain it | 63 // There should be no focus on load, so this will trigger when we gain it |
| 63 // and then release it and so on. | 64 // and then release it and so on. |
| 64 static bool expected_has_focus = true; | 65 static bool expected_has_focus = true; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 88 } // namespace | 89 } // namespace |
| 89 | 90 |
| 90 | 91 |
| 91 void SetupTests() { | 92 void SetupTests() { |
| 92 // Each PPP_Instance function called by the browser acts as a test. | 93 // Each PPP_Instance function called by the browser acts as a test. |
| 93 } | 94 } |
| 94 | 95 |
| 95 void SetupPluginInterfaces() { | 96 void SetupPluginInterfaces() { |
| 96 RegisterPluginInterface(PPP_INSTANCE_INTERFACE, &ppp_instance_interface); | 97 RegisterPluginInterface(PPP_INSTANCE_INTERFACE, &ppp_instance_interface); |
| 97 } | 98 } |
| OLD | NEW |