| 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..dd9fad4bb919ede03709a3b0364bc8a8fd14bd85 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,19 @@ 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++) {
|
| + 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);
|
| + }
|
| +}
|
|
|