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

Unified Diff: ppapi/tests/test_host_resolver_private_disallowed.cc

Issue 14139012: PPAPI: More test cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Provide a message loop for "background thread" test so we can use a REQUIRED callback Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_host_resolver_private.cc ('k') | ppapi/tests/test_net_address_private_untrusted.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_host_resolver_private_disallowed.cc
diff --git a/ppapi/tests/test_host_resolver_private_disallowed.cc b/ppapi/tests/test_host_resolver_private_disallowed.cc
index cc5bce00412ad97547ef6e907431274986ceeda5..3c0e0d59f793f4a46cdeb9f6737645eb34cde682 100644
--- a/ppapi/tests/test_host_resolver_private_disallowed.cc
+++ b/ppapi/tests/test_host_resolver_private_disallowed.cc
@@ -33,7 +33,7 @@ bool TestHostResolverPrivateDisallowed::Init() {
}
void TestHostResolverPrivateDisallowed::RunTests(const std::string& filter) {
- RUN_TEST_FORCEASYNC_AND_NOT(Resolve, filter);
+ RUN_CALLBACK_TEST(TestHostResolverPrivateDisallowed, Resolve, filter);
}
std::string TestHostResolverPrivateDisallowed::TestResolve() {
@@ -41,14 +41,10 @@ std::string TestHostResolverPrivateDisallowed::TestResolve() {
PP_HostResolver_Private_Hint hint;
hint.family = PP_NETADDRESSFAMILY_UNSPECIFIED;
hint.flags = PP_HOST_RESOLVER_FLAGS_CANONNAME;
- TestCompletionCallback callback(instance_->pp_instance(), force_async_);
- int32_t rv = host_resolver.Resolve(host_, port_, hint,
- callback.GetCallback());
- if (force_async_ && rv != PP_OK_COMPLETIONPENDING)
- return ReportError("PPB_HostResolver_Private::Resolve force_async", rv);
- if (rv == PP_OK_COMPLETIONPENDING)
- rv = callback.WaitForResult();
- if (rv != PP_ERROR_FAILED)
- return "PPB_HostResolver_Private can resolve without allowing switch";
+ TestCompletionCallback callback(instance_->pp_instance(), callback_type());
+ callback.WaitForResult(
+ host_resolver.Resolve(host_, port_, hint, callback.GetCallback()));
+ CHECK_CALLBACK_BEHAVIOR(callback);
+ ASSERT_EQ(PP_ERROR_FAILED, callback.result());
PASS();
}
« no previous file with comments | « ppapi/tests/test_host_resolver_private.cc ('k') | ppapi/tests/test_net_address_private_untrusted.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698