Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: ppapi/tests/test_output_protection_private.cc

Issue 24039002: Pepper API implementation for output protection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix build for non-chromeos Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/tests/test_output_protection_private.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/tests/test_output_protection_private.h"
6
7 #include "ppapi/tests/testing_instance.h"
8
9 REGISTER_TEST_CASE(OutputProtectionPrivate);
10
11 TestOutputProtectionPrivate::TestOutputProtectionPrivate(
12 TestingInstance* instance)
13 : TestCase(instance) {
14 }
15
16 bool TestOutputProtectionPrivate::Init() {
17 output_protection_interface_ =
18 static_cast<const PPB_OutputProtection_Private*>(
19 pp::Module::Get()->GetBrowserInterface(
20 PPB_OUTPUTPROTECTION_PRIVATE_INTERFACE_0_1));
21 return output_protection_interface_ && CheckTestingInterface();
22 }
23
24 void TestOutputProtectionPrivate::RunTests(const std::string& filter) {
25 RUN_TEST(QueryStatus, filter);
26 RUN_TEST(EnableProtection, filter);
27 }
28
29 std::string TestOutputProtectionPrivate::TestQueryStatus() {
30 TestCompletionCallback callback(instance_->pp_instance(), callback_type());
31
32 PP_Resource output_protection_resource = output_protection_interface_->
33 Create(instance_->pp_instance());
34 uint32_t link_mask;
35 uint32_t protection_mask;
36 callback.WaitForResult(
37 output_protection_interface_->QueryStatus(
38 output_protection_resource,
39 &link_mask,
40 &protection_mask,
41 callback.GetCallback().pp_completion_callback()));
42 CHECK_CALLBACK_BEHAVIOR(callback);
43
44 PASS();
45 }
46
47 std::string TestOutputProtectionPrivate::TestEnableProtection() {
48 TestCompletionCallback callback(instance_->pp_instance(), callback_type());
49
50 PP_Resource output_protection_resource = output_protection_interface_->
51 Create(instance_->pp_instance());
52 callback.WaitForResult(
53 output_protection_interface_->EnableProtection(
54 output_protection_resource,
55 PP_OUTPUT_PROTECTION_METHOD_PRIVATE_NONE,
56 callback.GetCallback().pp_completion_callback()));
57 CHECK_CALLBACK_BEHAVIOR(callback);
58
59 PASS();
60 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_output_protection_private.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698