Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc

Issue 2767253006: Set HexSSID in network config before matching it against policies (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 chromeos::NetworkHandler::Get() 718 chromeos::NetworkHandler::Get()
719 ->managed_network_configuration_handler() 719 ->managed_network_configuration_handler()
720 ->SetPolicy(::onc::ONC_SOURCE_DEVICE_POLICY, 720 ->SetPolicy(::onc::ONC_SOURCE_DEVICE_POLICY,
721 std::string() /* no username hash */, base::ListValue(), 721 std::string() /* no username hash */, base::ListValue(),
722 global_config); 722 global_config);
723 base::RunLoop().RunUntilIdle(); 723 base::RunLoop().RunUntilIdle();
724 724
725 EXPECT_TRUE(RunNetworkingSubtest("getGlobalPolicy")) << message_; 725 EXPECT_TRUE(RunNetworkingSubtest("getGlobalPolicy")) << message_;
726 } 726 }
727 727
728 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest,
729 CreateConfigForPolicyControlledNetwork) {
730 const std::string user_policy_blob =
731 "{ \"NetworkConfigurations\": ["
732 " { \"GUID\": \"stub_wifi2\","
733 " \"Type\": \"WiFi\","
734 " \"Name\": \"My WiFi Network\","
735 " \"WiFi\": {"
736 " \"HexSSID\": \"77696669325F50534B\"," // "wifi2_PSK"
737 " \"Passphrase\": \"passphrase\","
738 " \"Recommended\": [ \"AutoConnect\", \"Passphrase\" ],"
739 " \"Security\": \"WPA-PSK\" }"
740 " }"
741 " ],"
742 " \"Certificates\": [],"
743 " \"Type\": \"UnencryptedConfiguration\""
744 "}";
745
746 policy::PolicyMap policy;
747 policy.Set(policy::key::kOpenNetworkConfiguration,
748 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
749 policy::POLICY_SOURCE_CLOUD,
750 base::WrapUnique(new base::Value(user_policy_blob)), nullptr);
751 provider_.UpdateChromePolicy(policy);
752
753 content::RunAllPendingInMessageLoop();
754
755 EXPECT_TRUE(RunNetworkingSubtest("createConfigForPolicyControlledNetwork"));
756 }
757
728 // Tests subset of networking API for the networking API alias - to verify that 758 // Tests subset of networking API for the networking API alias - to verify that
729 // using API methods and event does not cause access exceptions (due to 759 // using API methods and event does not cause access exceptions (due to
730 // missing permissions). 760 // missing permissions).
731 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, Alias) { 761 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, Alias) {
732 EXPECT_TRUE(RunPlatformAppTest("networking_private/alias")) << message_; 762 EXPECT_TRUE(RunPlatformAppTest("networking_private/alias")) << message_;
733 } 763 }
734 764
735 } // namespace 765 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698