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

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
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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 543 }
544 544
545 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, SetVPNProperties) { 545 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, SetVPNProperties) {
546 EXPECT_TRUE(RunNetworkingSubtest("setVPNProperties")) << message_; 546 EXPECT_TRUE(RunNetworkingSubtest("setVPNProperties")) << message_;
547 } 547 }
548 548
549 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CreateNetwork) { 549 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CreateNetwork) {
550 EXPECT_TRUE(RunNetworkingSubtest("createNetwork")) << message_; 550 EXPECT_TRUE(RunNetworkingSubtest("createNetwork")) << message_;
551 } 551 }
552 552
553 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest,
554 CreateNetworkForPolicyControlledNetwork) {
555 const std::string user_policy_blob =
556 "{ \"NetworkConfigurations\": ["
Devlin 2017/03/28 01:34:40 Optional drive-by: This seems like a delightful ti
tbarzic 2017/03/28 04:00:22 Done.
557 " { \"GUID\": \"stub_wifi2\","
558 " \"Type\": \"WiFi\","
559 " \"Name\": \"My WiFi Network\","
560 " \"WiFi\": {"
561 " \"HexSSID\": \"77696669325F50534B\"," // "wifi2_PSK"
562 " \"Passphrase\": \"passphrase\","
563 " \"Recommended\": [ \"AutoConnect\", \"Passphrase\" ],"
564 " \"Security\": \"WPA-PSK\" }"
565 " }"
566 " ],"
567 " \"Certificates\": [],"
568 " \"Type\": \"UnencryptedConfiguration\""
569 "}";
570
571 policy::PolicyMap policy;
572 policy.Set(policy::key::kOpenNetworkConfiguration,
573 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
574 policy::POLICY_SOURCE_CLOUD,
575 base::WrapUnique(new base::Value(user_policy_blob)), nullptr);
576 provider_.UpdateChromePolicy(policy);
577
578 content::RunAllPendingInMessageLoop();
579
580 EXPECT_TRUE(RunNetworkingSubtest("createNetworkForPolicyControlledNetwork"));
581 }
582
553 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, ForgetNetwork) { 583 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, ForgetNetwork) {
554 EXPECT_TRUE(RunNetworkingSubtest("forgetNetwork")) << message_; 584 EXPECT_TRUE(RunNetworkingSubtest("forgetNetwork")) << message_;
555 } 585 }
556 586
557 // TODO(stevenjb): Find a better way to set this up on Chrome OS. 587 // TODO(stevenjb): Find a better way to set this up on Chrome OS.
558 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, GetManagedProperties) { 588 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, GetManagedProperties) {
559 const std::string uidata_blob = 589 const std::string uidata_blob =
560 "{ \"user_settings\": {" 590 "{ \"user_settings\": {"
561 " \"WiFi\": {" 591 " \"WiFi\": {"
562 " \"Passphrase\": \"FAKE_CREDENTIAL_VPaJDV9x\" }" 592 " \"Passphrase\": \"FAKE_CREDENTIAL_VPaJDV9x\" }"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 } 756 }
727 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/networking_private/chromeos/test.js » ('j') | extensions/browser/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698