@@ -1235,139 +1235,6 @@ TEST_F(IncomingShareSessionTest, AcceptTransferSuccess) {
12351235 ConnectionResponseFrame::ACCEPT);
12361236}
12371237
1238- TEST_F (IncomingShareSessionTest, ProcessKeyVerificationResultSuccess) {
1239- session_.OnConnected (&connection_);
1240- session_.SetTokenForTests (" 1234" );
1241-
1242- bool introduction_received = false ;
1243- EXPECT_THAT (
1244- session_.ProcessKeyVerificationResult (
1245- PairedKeyVerificationRunner::PairedKeyVerificationResult::kSuccess ,
1246- OSType::WINDOWS,
1247- [&introduction_received](std::optional<IntroductionFrame>) {
1248- introduction_received = true ;
1249- }),
1250- IsTrue ());
1251-
1252- EXPECT_THAT (session_.self_share (), IsFalse ());
1253- EXPECT_THAT (session_.token (), IsEmpty ());
1254- EXPECT_THAT (session_.os_type (), Eq (OSType::WINDOWS));
1255- EXPECT_THAT (introduction_received, IsFalse ());
1256-
1257- // Send Introduction frame
1258- nearby::sharing::service::proto::Frame frame =
1259- nearby::sharing::service::proto::Frame ();
1260- frame.set_version (nearby::sharing::service::proto::Frame::V1);
1261- V1Frame* v1frame = frame.mutable_v1 ();
1262- v1frame->set_type (service::proto::V1Frame::INTRODUCTION);
1263- v1frame->mutable_introduction ();
1264- std::vector<uint8_t > data;
1265- data.resize (frame.ByteSizeLong ());
1266- EXPECT_THAT (frame.SerializeToArray (data.data (), data.size ()), IsTrue ());
1267- connection_.WriteMessage (std::move (data));
1268-
1269- EXPECT_THAT (introduction_received, IsTrue ());
1270- }
1271-
1272- TEST_F (IncomingShareSessionTest, ProcessKeyVerificationResultFail) {
1273- session_.OnConnected (&connection_);
1274- session_.SetTokenForTests (" 1234" );
1275-
1276- bool introduction_received = false ;
1277- EXPECT_THAT (
1278- session_.ProcessKeyVerificationResult (
1279- PairedKeyVerificationRunner::PairedKeyVerificationResult::kFail ,
1280- OSType::WINDOWS,
1281- [&introduction_received](std::optional<IntroductionFrame>) {
1282- introduction_received = true ;
1283- }),
1284- IsFalse ());
1285-
1286- EXPECT_THAT (session_.token (), Eq (" 1234" ));
1287- EXPECT_THAT (session_.os_type (), Eq (OSType::WINDOWS));
1288- EXPECT_THAT (introduction_received, IsFalse ());
1289-
1290- // Send Introduction frame
1291- nearby::sharing::service::proto::Frame frame =
1292- nearby::sharing::service::proto::Frame ();
1293- frame.set_version (nearby::sharing::service::proto::Frame::V1);
1294- V1Frame* v1frame = frame.mutable_v1 ();
1295- v1frame->set_type (service::proto::V1Frame::INTRODUCTION);
1296- v1frame->mutable_introduction ();
1297- std::vector<uint8_t > data;
1298- data.resize (frame.ByteSizeLong ());
1299- EXPECT_THAT (frame.SerializeToArray (data.data (), data.size ()), IsTrue ());
1300- connection_.WriteMessage (std::move (data));
1301-
1302- EXPECT_THAT (introduction_received, IsFalse ());
1303- }
1304-
1305- TEST_F (IncomingShareSessionTest, ProcessKeyVerificationResultUnable) {
1306- session_.OnConnected (&connection_);
1307- session_.SetTokenForTests (" 1234" );
1308-
1309- bool introduction_received = false ;
1310- EXPECT_THAT (
1311- session_.ProcessKeyVerificationResult (
1312- PairedKeyVerificationRunner::PairedKeyVerificationResult::kUnable ,
1313- OSType::WINDOWS,
1314- [&introduction_received](std::optional<IntroductionFrame>) {
1315- introduction_received = true ;
1316- }),
1317- IsTrue ());
1318-
1319- EXPECT_THAT (session_.token (), Eq (" 1234" ));
1320- EXPECT_THAT (session_.os_type (), Eq (OSType::WINDOWS));
1321- EXPECT_THAT (introduction_received, IsFalse ());
1322-
1323- // Send Introduction frame
1324- nearby::sharing::service::proto::Frame frame =
1325- nearby::sharing::service::proto::Frame ();
1326- frame.set_version (nearby::sharing::service::proto::Frame::V1);
1327- V1Frame* v1frame = frame.mutable_v1 ();
1328- v1frame->set_type (service::proto::V1Frame::INTRODUCTION);
1329- v1frame->mutable_introduction ();
1330- std::vector<uint8_t > data;
1331- data.resize (frame.ByteSizeLong ());
1332- EXPECT_THAT (frame.SerializeToArray (data.data (), data.size ()), IsTrue ());
1333- connection_.WriteMessage (std::move (data));
1334-
1335- EXPECT_THAT (introduction_received, IsTrue ());
1336- }
1337-
1338- TEST_F (IncomingShareSessionTest, ProcessKeyVerificationResultUnknown) {
1339- session_.OnConnected (&connection_);
1340- session_.SetTokenForTests (" 1234" );
1341-
1342- bool introduction_received = false ;
1343- EXPECT_THAT (
1344- session_.ProcessKeyVerificationResult (
1345- PairedKeyVerificationRunner::PairedKeyVerificationResult::kUnknown ,
1346- OSType::WINDOWS,
1347- [&introduction_received](std::optional<IntroductionFrame>) {
1348- introduction_received = true ;
1349- }),
1350- IsFalse ());
1351-
1352- EXPECT_THAT (session_.token (), Eq (" 1234" ));
1353- EXPECT_THAT (session_.os_type (), Eq (OSType::WINDOWS));
1354- EXPECT_THAT (introduction_received, IsFalse ());
1355-
1356- // Send Introduction frame
1357- nearby::sharing::service::proto::Frame frame =
1358- nearby::sharing::service::proto::Frame ();
1359- frame.set_version (nearby::sharing::service::proto::Frame::V1);
1360- V1Frame* v1frame = frame.mutable_v1 ();
1361- v1frame->set_type (service::proto::V1Frame::INTRODUCTION);
1362- v1frame->mutable_introduction ();
1363- std::vector<uint8_t > data;
1364- data.resize (frame.ByteSizeLong ());
1365- EXPECT_THAT (frame.SerializeToArray (data.data (), data.size ()), IsTrue ());
1366- connection_.WriteMessage (std::move (data));
1367-
1368- EXPECT_THAT (introduction_received, IsFalse ());
1369- }
1370-
13711238TEST_F (IncomingShareSessionTest, TryUpgradeBandwidthNotNeeded) {
13721239 session_.OnConnected (&connection_);
13731240
0 commit comments