const char kUnknownCellularDevicePath[] = "unknown_cellular_device";
const char kDefaultWifiDevicePath[] = "stub_wifi_device";
const char kResultSuccess[] = "success";
+const char kDefaultPin[] = "1111";
} // namespace
}
TEST_F(NetworkDeviceHandlerTest, RequirePin) {
- const char kPin[] = "1234";
-
// Test that the success callback gets called.
network_device_handler_->RequirePin(kDefaultCellularDevicePath,
true,
- kPin,
+ kDefaultPin,
success_callback_,
error_callback_);
message_loop_.RunUntilIdle();
// Test that the shill error propagates to the error callback.
network_device_handler_->RequirePin(kUnknownCellularDevicePath,
true,
- kPin,
+ kDefaultPin,
success_callback_,
error_callback_);
message_loop_.RunUntilIdle();
}
TEST_F(NetworkDeviceHandlerTest, EnterPin) {
- const char kPin[] = "1234";
-
// Test that the success callback gets called.
- network_device_handler_->EnterPin(
- kDefaultCellularDevicePath, kPin, success_callback_, error_callback_);
+ network_device_handler_->EnterPin(kDefaultCellularDevicePath,
+ kDefaultPin,
+ success_callback_,
+ error_callback_);
message_loop_.RunUntilIdle();
EXPECT_EQ(kResultSuccess, result_);
// Test that the shill error propagates to the error callback.
- network_device_handler_->EnterPin(
- kUnknownCellularDevicePath, kPin, success_callback_, error_callback_);
+ network_device_handler_->EnterPin(kUnknownCellularDevicePath,
+ kDefaultPin,
+ success_callback_,
+ error_callback_);
message_loop_.RunUntilIdle();
EXPECT_EQ(NetworkDeviceHandler::kErrorDeviceMissing, result_);
}