Index: chrome/test/chromedriver/net/port_server_unittest.cc |
diff --git a/chrome/test/chromedriver/net/port_server_unittest.cc b/chrome/test/chromedriver/net/port_server_unittest.cc |
index f96043ad062b698975b98337253124ec6f7870c7..4ece223cba6507d22419521712f7bdd6f96ba85e 100644 |
--- a/chrome/test/chromedriver/net/port_server_unittest.cc |
+++ b/chrome/test/chromedriver/net/port_server_unittest.cc |
@@ -188,7 +188,7 @@ TEST_F(PortServerTest, ReserveReserve) { |
} |
#endif |
-TEST(PortManagerTest, Reserve) { |
+TEST(PortManagerTest, ReservePort) { |
PortManager mgr(15000, 16000); |
int port = 0; |
scoped_ptr<PortReservation> reservation; |
@@ -199,3 +199,20 @@ TEST(PortManagerTest, Reserve) { |
ASSERT_LE(port, 16000); |
ASSERT_TRUE(reservation); |
} |
+ |
+TEST(PortManagerTest, ReservePortFromPool) { |
+ PortManager mgr(15000, 16000); |
+ int first_port = 0, port = 1; |
+ for (int i = 0; i < 10; i++) |
+ { |
craigdh
2014/01/09 01:45:06
google style guide has { on the same line as the f
frankf
2014/01/09 01:55:19
Done.
|
+ scoped_ptr<PortReservation> reservation; |
+ Status status = mgr.ReservePortFromPool(&port, &reservation); |
+ ASSERT_EQ(kOk, status.code()) << status.message(); |
+ ASSERT_TRUE(reservation); |
+ ASSERT_GE(port, 15000); |
+ ASSERT_LE(port, 16000); |
+ if (i == 0) |
+ first_port = port; |
+ ASSERT_EQ(port, first_port); |
+ } |
+} |