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