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

Unified Diff: ppapi/tests/test_network_monitor.cc

Issue 23450012: Make NetworkList and NetworkMonitor APIs public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
Index: ppapi/tests/test_network_monitor.cc
diff --git a/ppapi/tests/test_network_monitor_private.cc b/ppapi/tests/test_network_monitor.cc
similarity index 70%
rename from ppapi/tests/test_network_monitor_private.cc
rename to ppapi/tests/test_network_monitor.cc
index 382cbe0feac7cf22f628240a82f29fdf1a2e45b4..53b6bb2b0d3eb8dce5a37a1442cfee844e2c2d87 100644
--- a/ppapi/tests/test_network_monitor_private.cc
+++ b/ppapi/tests/test_network_monitor.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ppapi/tests/test_network_monitor_private.h"
+#include "ppapi/tests/test_network_monitor.h"
#include <string.h>
@@ -10,19 +10,19 @@
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/net_address.h"
-#include "ppapi/cpp/private/network_list_private.h"
-#include "ppapi/cpp/private/network_monitor_private.h"
-#include "ppapi/tests/testing_instance.h"
+#include "ppapi/cpp/network_list.h"
+#include "ppapi/cpp/network_monitor.h"
#include "ppapi/tests/test_utils.h"
+#include "ppapi/tests/testing_instance.h"
-REGISTER_TEST_CASE(NetworkMonitorPrivate);
+REGISTER_TEST_CASE(NetworkMonitor);
namespace {
class MonitorDeletionCallbackDelegate
: public TestCompletionCallback::Delegate {
public:
- explicit MonitorDeletionCallbackDelegate(pp::NetworkMonitorPrivate* monitor)
+ explicit MonitorDeletionCallbackDelegate(pp::NetworkMonitor* monitor)
: monitor_(monitor) {
}
@@ -32,30 +32,30 @@ class MonitorDeletionCallbackDelegate
}
private:
- pp::NetworkMonitorPrivate* monitor_;
+ pp::NetworkMonitor* monitor_;
};
} // namespace
-TestNetworkMonitorPrivate::TestNetworkMonitorPrivate(TestingInstance* instance)
+TestNetworkMonitor::TestNetworkMonitor(TestingInstance* instance)
: TestCase(instance) {
}
-bool TestNetworkMonitorPrivate::Init() {
- if (!pp::NetworkMonitorPrivate::IsAvailable())
+bool TestNetworkMonitor::Init() {
+ if (!pp::NetworkMonitor::IsAvailable())
return false;
return CheckTestingInterface();
}
-void TestNetworkMonitorPrivate::RunTests(const std::string& filter) {
+void TestNetworkMonitor::RunTests(const std::string& filter) {
RUN_TEST_FORCEASYNC_AND_NOT(Basic, filter);
RUN_TEST_FORCEASYNC_AND_NOT(2Monitors, filter);
RUN_TEST_FORCEASYNC_AND_NOT(DeleteInCallback, filter);
}
-std::string TestNetworkMonitorPrivate::VerifyNetworkList(
- const pp::NetworkListPrivate& network_list) {
+std::string TestNetworkMonitor::VerifyNetworkList(
+ const pp::NetworkList& network_list) {
// Verify that there is at least one network interface.
size_t count = network_list.GetCount();
ASSERT_TRUE(count >= 1U);
@@ -118,22 +118,22 @@ std::string TestNetworkMonitorPrivate::VerifyNetworkList(
ASSERT_FALSE(network_list.GetName(iface).empty());
ASSERT_FALSE(network_list.GetDisplayName(iface).empty());
- PP_NetworkListType_Private type = network_list.GetType(iface);
- ASSERT_TRUE(type >= PP_NETWORKLIST_UNKNOWN);
- ASSERT_TRUE(type <= PP_NETWORKLIST_CELLULAR);
+ PP_NetworkList_Type type = network_list.GetType(iface);
+ ASSERT_TRUE(type >= PP_NETWORKLIST_TYPE_UNKNOWN);
+ ASSERT_TRUE(type <= PP_NETWORKLIST_TYPE_CELLULAR);
- PP_NetworkListState_Private state = network_list.GetState(iface);
- ASSERT_TRUE(state >= PP_NETWORKLIST_DOWN);
- ASSERT_TRUE(state <= PP_NETWORKLIST_UP);
+ PP_NetworkList_State state = network_list.GetState(iface);
+ ASSERT_TRUE(state >= PP_NETWORKLIST_STATE_DOWN);
+ ASSERT_TRUE(state <= PP_NETWORKLIST_STATE_UP);
}
PASS();
}
-std::string TestNetworkMonitorPrivate::TestBasic() {
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+std::string TestNetworkMonitor::TestBasic() {
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor(instance_);
+ pp::NetworkMonitor network_monitor(instance_);
test_callback.WaitForResult(
network_monitor.UpdateNetworkList(test_callback.GetCallback()));
@@ -143,19 +143,19 @@ std::string TestNetworkMonitorPrivate::TestBasic() {
PASS();
}
-std::string TestNetworkMonitorPrivate::Test2Monitors() {
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+std::string TestNetworkMonitor::Test2Monitors() {
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor(instance_);
+ pp::NetworkMonitor network_monitor(instance_);
test_callback.WaitForResult(
network_monitor.UpdateNetworkList(test_callback.GetCallback()));
ASSERT_EQ(test_callback.result(), PP_OK);
ASSERT_SUBTEST_SUCCESS(VerifyNetworkList(test_callback.output()));
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback_2(
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback_2(
instance_->pp_instance());
- pp::NetworkMonitorPrivate network_monitor_2(instance_);
+ pp::NetworkMonitor network_monitor_2(instance_);
test_callback_2.WaitForResult(
network_monitor_2.UpdateNetworkList(test_callback_2.GetCallback()));
@@ -165,11 +165,11 @@ std::string TestNetworkMonitorPrivate::Test2Monitors() {
PASS();
}
-std::string TestNetworkMonitorPrivate::TestDeleteInCallback() {
- pp::NetworkMonitorPrivate* network_monitor =
- new pp::NetworkMonitorPrivate(instance_);
+std::string TestNetworkMonitor::TestDeleteInCallback() {
+ pp::NetworkMonitor* network_monitor =
+ new pp::NetworkMonitor(instance_);
MonitorDeletionCallbackDelegate deletion_delegate(network_monitor);
- TestCompletionCallbackWithOutput<pp::NetworkListPrivate> test_callback(
+ TestCompletionCallbackWithOutput<pp::NetworkList> test_callback(
instance_->pp_instance());
test_callback.SetDelegate(&deletion_delegate);
test_callback.WaitForResult(

Powered by Google App Engine
This is Rietveld 408576698