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
3 // found in the LICENSE file.
5 #include "ppapi/tests/test_cursor_control.h"
7 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/tests/testing_instance.h"
11 REGISTER_TEST_CASE(CursorControl
);
13 TestCursorControl::TestCursorControl(TestingInstance
* instance
)
15 cursor_control_interface_(NULL
) {
18 bool TestCursorControl::Init() {
19 cursor_control_interface_
= static_cast<const PPB_CursorControl_Dev
*>(
20 pp::Module::Get()->GetBrowserInterface(PPB_CURSOR_CONTROL_DEV_INTERFACE
));
21 return !!cursor_control_interface_
;
24 void TestCursorControl::RunTests(const std::string
& filter
) {
25 RUN_TEST(SetCursor
, filter
);
28 std::string
TestCursorControl::TestSetCursor() {
29 // Very simplistic test to make sure we can actually call the function and
30 // it reports success. This is a nice integration test to make sure the
31 // interface is hooked up. Obviously it's not easy in a plugin to test whether
32 // the mouse cursor actually changed.
33 ASSERT_TRUE(cursor_control_interface_
->SetCursor(instance_
->pp_instance(),
34 PP_CURSORTYPE_WAIT
, 0, NULL
));