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

Unified Diff: chrome/browser/extensions/api/socket/socket_apitest.cc

Issue 233633003: Cleanup a TODO and other nits in SocketApiTest. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/socket/socket_apitest.cc
===================================================================
--- chrome/browser/extensions/api/socket/socket_apitest.cc (revision 262630)
+++ chrome/browser/extensions/api/socket/socket_apitest.cc (working copy)
@@ -11,7 +11,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -20,6 +19,12 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
+#if !defined(DISABLE_NACL)
+#include "base/command_line.h"
+#include "chrome/browser/ui/extensions/application_launch.h"
+#include "ppapi/shared_impl/ppapi_switches.h"
+#endif
+
using extensions::Extension;
namespace utils = extension_function_test_utils;
@@ -68,18 +73,18 @@
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
SocketApiTest::SetUpCommandLine(command_line);
- // TODO(yzshen): It is better to use switches::kEnablePepperTesting.
- // However, that requires adding a new DEPS entry. Considering that we are
- // going to move the Pepper API tests to a new place, use a string literal
- // for now.
- command_line->AppendSwitch("enable-pepper-testing");
+ command_line->AppendSwitch(switches::kEnablePepperTesting);
}
virtual void SetUpOnMainThread() OVERRIDE {
SocketApiTest::SetUpOnMainThread();
- PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_);
- app_dir_ = app_dir_.AppendASCII("ppapi/tests/extensions/socket/newlib");
+ ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &app_dir_));
+ app_dir_ = app_dir_.AppendASCII("ppapi")
+ .AppendASCII("tests")
+ .AppendASCII("extensions")
+ .AppendASCII("socket")
+ .AppendASCII("newlib");
}
protected:
@@ -98,7 +103,7 @@
private:
base::FilePath app_dir_;
};
-#endif
+#endif // !defined(DISABLE_NACL)
} // namespace
@@ -115,9 +120,9 @@
ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
base::DictionaryValue *value =
static_cast<base::DictionaryValue*>(result.get());
- int socketId = -1;
- EXPECT_TRUE(value->GetInteger("socketId", &socketId));
- EXPECT_TRUE(socketId > 0);
+ int socket_id = -1;
+ EXPECT_TRUE(value->GetInteger("socketId", &socket_id));
+ EXPECT_GT(socket_id, 0);
}
IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPCreateGood) {
@@ -133,9 +138,9 @@
ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
base::DictionaryValue *value =
static_cast<base::DictionaryValue*>(result.get());
- int socketId = -1;
- EXPECT_TRUE(value->GetInteger("socketId", &socketId));
- ASSERT_TRUE(socketId > 0);
+ int socket_id = -1;
+ EXPECT_TRUE(value->GetInteger("socketId", &socket_id));
+ ASSERT_GT(socket_id, 0);
}
IN_PROC_BROWSER_TEST_F(SocketApiTest, GetNetworkList) {
@@ -153,7 +158,7 @@
// If we're invoking socket tests, all we can confirm is that we have at
// least one address, but not what it is.
base::ListValue *value = static_cast<base::ListValue*>(result.get());
- ASSERT_TRUE(value->GetSize() > 0);
+ ASSERT_GT(value->GetSize(), 0U);
}
IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketUDPExtension) {
@@ -166,7 +171,7 @@
net::HostPortPair host_port_pair = test_server->host_port_pair();
int port = host_port_pair.port();
- ASSERT_TRUE(port > 0);
+ ASSERT_GT(port, 0);
// Test that sendTo() is properly resolving hostnames.
host_port_pair.set_host("LOCALhost");
@@ -194,7 +199,7 @@
net::HostPortPair host_port_pair = test_server->host_port_pair();
int port = host_port_pair.port();
- ASSERT_TRUE(port > 0);
+ ASSERT_GT(port, 0);
// Test that connect() is properly resolving hostnames.
host_port_pair.set_host("lOcAlHoSt");
@@ -268,7 +273,7 @@
net::HostPortPair host_port_pair = test_server->host_port_pair();
int port = host_port_pair.port();
- ASSERT_TRUE(port > 0);
+ ASSERT_GT(port, 0);
// Test that sendTo() is properly resolving hostnames.
host_port_pair.set_host("LOCALhost");
@@ -303,7 +308,7 @@
net::HostPortPair host_port_pair = test_server->host_port_pair();
int port = host_port_pair.port();
- ASSERT_TRUE(port > 0);
+ ASSERT_GT(port, 0);
// Test that connect() is properly resolving hostnames.
host_port_pair.set_host("lOcAlHoSt");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698