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

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, 8 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/networking_private/chromeos/test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 592 }
593 593
594 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, SetVPNProperties) { 594 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, SetVPNProperties) {
595 EXPECT_TRUE(RunNetworkingSubtest("setVPNProperties")) << message_; 595 EXPECT_TRUE(RunNetworkingSubtest("setVPNProperties")) << message_;
596 } 596 }
597 597
598 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CreateNetwork) { 598 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CreateNetwork) {
599 EXPECT_TRUE(RunNetworkingSubtest("createNetwork")) << message_; 599 EXPECT_TRUE(RunNetworkingSubtest("createNetwork")) << message_;
600 } 600 }
601 601
602 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest,
603 CreateNetworkForPolicyControlledNetwork) {
604 const std::string user_policy_blob =
605 R"({
606 "NetworkConfigurations": [{
607 "GUID": "stub_wifi2",
608 "Type": "WiFi",
609 "Name": "My WiFi Network",
610 "WiFi": {
611 "HexSSID": "77696669325F50534B",
612 "Passphrase": "passphrase",
613 "Recommended": [ "AutoConnect", "Passphrase" ],
614 "Security": "WPA-PSK"
615 }
616 }],
617 "Certificates": [],
618 "Type": "UnencryptedConfiguration"
619 })";
620
621 policy::PolicyMap policy;
622 policy.Set(policy::key::kOpenNetworkConfiguration,
623 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
624 policy::POLICY_SOURCE_CLOUD,
625 base::WrapUnique(new base::Value(user_policy_blob)), nullptr);
626 provider_.UpdateChromePolicy(policy);
627
628 content::RunAllPendingInMessageLoop();
629
630 EXPECT_TRUE(RunNetworkingSubtest("createNetworkForPolicyControlledNetwork"));
631 }
632
602 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, ForgetNetwork) { 633 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, ForgetNetwork) {
603 EXPECT_TRUE(RunNetworkingSubtest("forgetNetwork")) << message_; 634 EXPECT_TRUE(RunNetworkingSubtest("forgetNetwork")) << message_;
604 } 635 }
605 636
606 // TODO(stevenjb): Find a better way to set this up on Chrome OS. 637 // TODO(stevenjb): Find a better way to set this up on Chrome OS.
607 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, GetManagedProperties) { 638 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, GetManagedProperties) {
608 const std::string uidata_blob = 639 const std::string uidata_blob =
609 "{ \"user_settings\": {" 640 "{ \"user_settings\": {"
610 " \"WiFi\": {" 641 " \"WiFi\": {"
611 " \"Passphrase\": \"FAKE_CREDENTIAL_VPaJDV9x\" }" 642 " \"Passphrase\": \"FAKE_CREDENTIAL_VPaJDV9x\" }"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 } 806 }
776 807
777 // Tests subset of networking API for the networking API alias - to verify that 808 // Tests subset of networking API for the networking API alias - to verify that
778 // using API methods and event does not cause access exceptions (due to 809 // using API methods and event does not cause access exceptions (due to
779 // missing permissions). 810 // missing permissions).
780 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, Alias) { 811 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, Alias) {
781 EXPECT_TRUE(RunPlatformAppTest("networking_private/alias")) << message_; 812 EXPECT_TRUE(RunPlatformAppTest("networking_private/alias")) << message_;
782 } 813 }
783 814
784 } // namespace 815 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/networking_private/chromeos/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698