Lines Matching refs:wifi_service
241 bool TestStorageSecurityIs(WiFiServiceRefPtr wifi_service, in TestStorageSecurityIs() argument
243 string id = wifi_service->GetStorageIdentifier(); in TestStorageSecurityIs()
257 WiFiServiceRefPtr wifi_service = MakeSimpleService(from_security); in TestStorageMapping() local
266 wifi_service->Save(&mock_store); in TestStorageMapping()
267 return TestStorageSecurityIs(wifi_service, to_security); in TestStorageMapping()
278 WiFiServiceRefPtr wifi_service = MakeSimpleService(service_security); in TestLoadMapping() local
288 ContainsWiFiProperties(wifi_service->ssid(), in TestLoadMapping()
292 bool is_loadable = wifi_service->IsLoadableFrom(mock_store); in TestLoadMapping()
294 bool is_loaded = wifi_service->Load(&mock_store); in TestLoadMapping()
298 wifi_service->GetLoadableStorageIdentifier(mock_store)); in TestLoadMapping()
305 return wifi_service->GetStorageIdentifier() == kStorageId; in TestLoadMapping()
419 WiFiServiceRefPtr wifi_service = MakeSimpleService(kSecurityNone); in TEST_F() local
420 string id = wifi_service->GetStorageIdentifier(); in TEST_F()
434 WiFiServiceRefPtr wifi_service = MakeSimpleService(kSecurityWpa); in TEST_F() local
436 (wifi_service->store()).GetStringPropertiesIter(); in TEST_F()
447 WiFiServiceRefPtr wifi_service = MakeSimpleService(kSecurityWep); in TEST_F() local
449 EXPECT_TRUE(wifi_service->mutable_store()->SetStringProperty( in TEST_F()
451 EXPECT_FALSE(wifi_service->mutable_store()->SetStringProperty( in TEST_F()
457 WiFiServiceRefPtr wifi_service = MakeSimpleService(kSecurityNone); in TEST_F() local
459 EXPECT_FALSE(wifi_service->mutable_store()->SetStringProperty( in TEST_F()
468 WiFiServiceRefPtr wifi_service = new WiFiService(control_interface(), in TEST_F() local
479 EXPECT_TRUE(wifi_service->store().GetProperties(&properties, nullptr)); in TEST_F()
499 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityNone); in TEST_F() local
500 wifi_service->AddEndpoint(endpoint1); in TEST_F()
501 wifi_service->AddEndpoint(endpoint2); in TEST_F()
503 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
504 wifi_service->Connect(nullptr, "in test"); in TEST_F()
509 WiFiServiceRefPtr wifi_service = MakeServiceWithMockManager(); in TEST_F() local
519 wifi_service->SetPreferredDevice(kDeviceName1, nullptr); in TEST_F()
520 wifi_service->AddEndpoint(endpoint1); in TEST_F()
521 wifi_service->AddEndpoint(endpoint2); in TEST_F()
522 EXPECT_EQ(wifi1, wifi_service->wifi_); in TEST_F()
524 EXPECT_CALL(*wifi1, ConnectTo(wifi_service.get())); in TEST_F()
526 wifi_service->Connect(nullptr, "in test"); in TEST_F()
530 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityWpa); in TEST_F() local
531 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
533 wifi_service->SetPassphrase("0:mumblemumblem", &error); in TEST_F()
534 wifi_service->Connect(nullptr, "in test"); in TEST_F()
535 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
540 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityRsn); in TEST_F() local
541 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
543 wifi_service->SetPassphrase("0:mumblemumblem", &error); in TEST_F()
544 wifi_service->Connect(nullptr, "in test"); in TEST_F()
545 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
551 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityNone); in TEST_F() local
554 wifi_service->set_profile(mock_profile); in TEST_F()
556 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
557 wifi_service->Connect(&error, "in test"); in TEST_F()
562 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())).Times(0); in TEST_F()
563 wifi_service->SetState(Service::kStateAssociating); in TEST_F()
564 wifi_service->Connect(&error, "in test"); in TEST_F()
565 wifi_service->SetState(Service::kStateConfiguring); in TEST_F()
566 wifi_service->Connect(&error, "in test"); in TEST_F()
567 wifi_service->SetState(Service::kStateConnected); in TEST_F()
568 wifi_service->Connect(&error, "in test"); in TEST_F()
569 wifi_service->SetState(Service::kStatePortal); in TEST_F()
570 wifi_service->Connect(&error, "in test"); in TEST_F()
571 wifi_service->SetState(Service::kStateOnline); in TEST_F()
572 wifi_service->Connect(&error, "in test"); in TEST_F()
577 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityPsk); in TEST_F() local
578 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
580 wifi_service->SetPassphrase("0:mumblemumblem", &error); in TEST_F()
581 wifi_service->Connect(nullptr, "in test"); in TEST_F()
582 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
620 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityNone); in TEST_F() local
621 wifi_service->AddEndpoint(endpoint_freq); in TEST_F()
622 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
623 wifi_service->Connect(nullptr, "in test"); in TEST_F()
625 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
628 wifi_service = new WiFiService(control_interface(), in TEST_F()
637 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
638 SetWiFiForService(wifi_service, wifi()); in TEST_F()
639 wifi_service->Connect(nullptr, "in test"); in TEST_F()
641 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
644 wifi_service = new WiFiService(control_interface(), in TEST_F()
653 wifi_service->AddEndpoint(endpoint_nofreq); in TEST_F()
654 SetWiFiForService(wifi_service, wifi()); in TEST_F()
655 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
656 wifi_service->Connect(nullptr, "in test"); in TEST_F()
658 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
661 wifi_service = new WiFiService(control_interface(), in TEST_F()
670 wifi_service->AddEndpoint(endpoint_freq); in TEST_F()
671 SetWiFiForService(wifi_service, wifi()); in TEST_F()
672 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
673 wifi_service->Connect(nullptr, "in test"); in TEST_F()
674 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
679 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityPsk); in TEST_F() local
683 wifi_service->AddEndpoint(endpoint); in TEST_F()
685 wifi_service->SetPassphrase("0:mumblemumblem", &error); in TEST_F()
686 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
687 wifi_service->Connect(nullptr, "in test"); in TEST_F()
690 wifi_service->GetSupplicantConfigurationParameters(); in TEST_F()
706 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityWep); in TEST_F() local
708 wifi_service->SetPassphrase("0:abcdefghijklm", &error); in TEST_F()
709 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
710 wifi_service->Connect(nullptr, "in test"); in TEST_F()
711 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
714 wifi_service->SetPassphrase("abcdefghijklm", &error); in TEST_F()
715 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
716 wifi_service->Connect(nullptr, "in test"); in TEST_F()
717 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
720 wifi_service->SetPassphrase("1:abcdefghijklm", &error); in TEST_F()
721 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
722 wifi_service->Connect(nullptr, "in test"); in TEST_F()
723 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
726 wifi_service->SetPassphrase("2:abcdefghijklm", &error); in TEST_F()
727 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
728 wifi_service->Connect(nullptr, "in test"); in TEST_F()
729 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
732 wifi_service->SetPassphrase("3:abcdefghijklm", &error); in TEST_F()
733 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
734 wifi_service->Connect(nullptr, "in test"); in TEST_F()
735 EXPECT_THAT(wifi_service->GetSupplicantConfigurationParameters(), in TEST_F()
741 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityWep); in TEST_F() local
743 wifi_service->mutable_eap()->SetKeyManagement("IEEE8021X", nullptr); in TEST_F()
744 wifi_service->mutable_eap()->set_identity("something"); in TEST_F()
745 wifi_service->mutable_eap()->set_password("mumble"); in TEST_F()
746 wifi_service->OnEapCredentialsChanged(Service::kReasonCredentialsLoaded); in TEST_F()
747 EXPECT_CALL(*wifi(), ConnectTo(wifi_service.get())); in TEST_F()
748 wifi_service->Connect(nullptr, "in test"); in TEST_F()
750 wifi_service->GetSupplicantConfigurationParameters(); in TEST_F()
759 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityRsn); in TEST_F() local
764 wifi_service->has_ever_connected_ = true; in TEST_F()
765 EXPECT_TRUE(wifi_service->has_ever_connected()); in TEST_F()
766 wifi_service->SetPassphrase(kPassphrase, &error); in TEST_F()
767 EXPECT_FALSE(wifi_service->has_ever_connected()); in TEST_F()
771 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityRsn); in TEST_F() local
778 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
779 wifi_service->SetPassphrase(kPassphrase, &error); in TEST_F()
788 wifi_service->SetPassphrase(kPassphrase, &error); in TEST_F()
796 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
797 wifi_service->SetPassphrase(kPassphrase + "X", &error); in TEST_F()
805 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
806 wifi_service->ClearPassphrase(&error); in TEST_F()
815 wifi_service->SetPassphrase("", &error); in TEST_F()
823 wifi_service->has_ever_connected_ = true; in TEST_F()
824 EXPECT_TRUE(wifi_service->has_ever_connected()); in TEST_F()
825 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())).Times(0); in TEST_F()
826 wifi_service->OnEapCredentialsChanged(Service::kReasonPropertyUpdate); in TEST_F()
827 EXPECT_TRUE(wifi_service->has_ever_connected()); in TEST_F()
861 WiFiServiceRefPtr wifi_service = in TEST_F() local
863 PropertyStore& property_store(*wifi_service->mutable_store()); in TEST_F()
870 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
888 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
900 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
918 EXPECT_CALL(*wifi(), ClearCachedCredentials(wifi_service.get())); in TEST_F()
1418 WiFiServiceRefPtr wifi_service = MakeSimpleService(kSecurityWep); in TEST_F() local
1420 EXPECT_EQ("", wifi_service->passphrase_); in TEST_F()
1425 wifi_service->mutable_store()->SetAnyProperty(kPassphraseProperty, in TEST_F()
1428 EXPECT_EQ(kPassphrase, wifi_service->passphrase_); in TEST_F()
1430 EXPECT_TRUE(wifi_service->mutable_store()->ClearProperty(kPassphraseProperty, in TEST_F()
1432 EXPECT_EQ("", wifi_service->passphrase_); in TEST_F()
1682 WiFiServiceRefPtr wifi_service = MakeServiceWithMockManager(); in TEST_F() local
1702 wifi_service->SetPreferredDevice(kDeviceName1, nullptr); in TEST_F()
1704 wifi_service->AddEndpoint(endpoint0); in TEST_F()
1705 wifi_service->AddEndpoint(endpoint1); in TEST_F()
1706 wifi_service->AddEndpoint(endpoint2); in TEST_F()
1707 wifi_service->AddEndpoint(endpoint3); in TEST_F()
1708 EXPECT_EQ(wifi1, wifi_service->wifi_); in TEST_F()
1712 wifi_service->strength()); in TEST_F()
2098 WiFiServiceRefPtr wifi_service = MakeServiceWithWiFi(kSecurityNone); in TEST_F() local
2099 ServiceMockAdaptor* adaptor = GetAdaptor(wifi_service.get()); in TEST_F()
2105 wifi_service->AddEndpoint(endpoint); in TEST_F()
2106 EXPECT_TRUE(wifi_service->IsVisible()); in TEST_F()
2111 wifi_service->RemoveEndpoint(endpoint); in TEST_F()
2112 EXPECT_FALSE(wifi_service->IsVisible()); in TEST_F()
2118 wifi_service->SetState(Service::kStateAssociating); in TEST_F()
2119 EXPECT_TRUE(wifi_service->IsVisible()); in TEST_F()
2124 wifi_service->SetState(Service::kStateConfiguring); in TEST_F()
2125 EXPECT_TRUE(wifi_service->IsVisible()); in TEST_F()
2130 wifi_service->SetState(Service::kStateIdle); in TEST_F()
2131 EXPECT_FALSE(wifi_service->IsVisible()); in TEST_F()