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

Unified Diff: ppapi/tests/test_broker.cc

Issue 11316316: Implement an IsAllowed function in the pepper PPB_Broker_Trusted API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_broker.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_broker.cc
diff --git a/ppapi/tests/test_broker.cc b/ppapi/tests/test_broker.cc
index 63bbd1cee5dd6d6aef4f1f4f19401bc739b90d70..d66e9dd73990ab4883338de30d22c6762d531b52 100644
--- a/ppapi/tests/test_broker.cc
+++ b/ppapi/tests/test_broker.cc
@@ -222,10 +222,14 @@ void TestBroker::RunTests(const std::string& filter) {
RUN_TEST(ConnectPermissionDenied, filter);
RUN_TEST(ConnectPermissionGranted, filter);
+ RUN_TEST(IsAllowedPermissionDenied, filter);
+ RUN_TEST(IsAllowedPermissionGranted, filter);
}
std::string TestBroker::TestCreate() {
// Very simplistic test to make sure we can create a broker interface.
+ // TODO(raymes): All of the resources created in this file are leaked. Write
+ // a C++ wrapper for PPB_Broker_Trusted to avoid these leaks.
PP_Resource broker = broker_interface_->CreateTrusted(
instance_->pp_instance());
ASSERT_TRUE(broker);
@@ -317,3 +321,20 @@ std::string TestBroker::TestConnectPermissionGranted() {
PASS();
}
+std::string TestBroker::TestIsAllowedPermissionDenied() {
+ PP_Resource broker = broker_interface_->CreateTrusted(
+ instance_->pp_instance());
+ ASSERT_TRUE(broker);
+ ASSERT_EQ(PP_FALSE, broker_interface_->IsAllowed(broker));
+
+ PASS();
+}
+
+std::string TestBroker::TestIsAllowedPermissionGranted() {
+ PP_Resource broker = broker_interface_->CreateTrusted(
+ instance_->pp_instance());
+ ASSERT_TRUE(broker);
+ ASSERT_EQ(PP_TRUE, broker_interface_->IsAllowed(broker));
+
+ PASS();
+}
« no previous file with comments | « ppapi/tests/test_broker.h ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698