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

Side by Side Diff: chrome/browser/net/errorpage_browsertest.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 1310
1311 policy::PolicyMap policy_map; 1311 policy::PolicyMap policy_map;
1312 #if defined(OS_CHROMEOS) 1312 #if defined(OS_CHROMEOS)
1313 if (enroll_) 1313 if (enroll_)
1314 SetEnterpriseUsersDefaults(&policy_map); 1314 SetEnterpriseUsersDefaults(&policy_map);
1315 #endif 1315 #endif
1316 if (set_allow_dinosaur_easter_egg_) { 1316 if (set_allow_dinosaur_easter_egg_) {
1317 policy_map.Set(policy::key::kAllowDinosaurEasterEgg, 1317 policy_map.Set(policy::key::kAllowDinosaurEasterEgg,
1318 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 1318 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
1319 policy::POLICY_SOURCE_CLOUD, 1319 policy::POLICY_SOURCE_CLOUD,
1320 base::MakeUnique<base::FundamentalValue>( 1320 base::MakeUnique<base::Value>(
1321 value_of_allow_dinosaur_easter_egg_), 1321 value_of_allow_dinosaur_easter_egg_),
1322 nullptr); 1322 nullptr);
1323 } 1323 }
1324 policy_provider_.UpdateChromePolicy(policy_map); 1324 policy_provider_.UpdateChromePolicy(policy_map);
1325 1325
1326 #if defined(OS_CHROMEOS) 1326 #if defined(OS_CHROMEOS)
1327 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( 1327 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
1328 &policy_provider_); 1328 &policy_provider_);
1329 #else 1329 #else
1330 policy::ProfilePolicyConnectorFactory::GetInstance() 1330 policy::ProfilePolicyConnectorFactory::GetInstance()
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest { 1505 class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest {
1506 public: 1506 public:
1507 // InProcessBrowserTest: 1507 // InProcessBrowserTest:
1508 void SetUp() override { 1508 void SetUp() override {
1509 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_)) 1509 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_))
1510 .WillRepeatedly(testing::Return(true)); 1510 .WillRepeatedly(testing::Return(true));
1511 policy::PolicyMap values; 1511 policy::PolicyMap values;
1512 values.Set(policy::key::kHttp09OnNonDefaultPortsEnabled, 1512 values.Set(policy::key::kHttp09OnNonDefaultPortsEnabled,
1513 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE, 1513 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_MACHINE,
1514 policy::POLICY_SOURCE_CLOUD, 1514 policy::POLICY_SOURCE_CLOUD,
1515 base::WrapUnique(new base::FundamentalValue(true)), nullptr); 1515 base::WrapUnique(new base::Value(true)), nullptr);
1516 policy_provider_.UpdateChromePolicy(values); 1516 policy_provider_.UpdateChromePolicy(values);
1517 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( 1517 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
1518 &policy_provider_); 1518 &policy_provider_);
1519 1519
1520 InProcessBrowserTest::SetUp(); 1520 InProcessBrowserTest::SetUp();
1521 } 1521 }
1522 1522
1523 private: 1523 private:
1524 policy::MockConfigurationPolicyProvider policy_provider_; 1524 policy::MockConfigurationPolicyProvider policy_provider_;
1525 }; 1525 };
1526 1526
1527 // Make sure HTTP/0.9 works on non-default ports when enabled by policy. 1527 // Make sure HTTP/0.9 works on non-default ports when enabled by policy.
1528 IN_PROC_BROWSER_TEST_F(ErrorPageWithHttp09OnNonDefaultPortsTest, 1528 IN_PROC_BROWSER_TEST_F(ErrorPageWithHttp09OnNonDefaultPortsTest,
1529 Http09WeirdPortEnabled) { 1529 Http09WeirdPortEnabled) {
1530 const char kHttp09Response[] = "JumboShrimp"; 1530 const char kHttp09Response[] = "JumboShrimp";
1531 ASSERT_TRUE(embedded_test_server()->Start()); 1531 ASSERT_TRUE(embedded_test_server()->Start());
1532 ui_test_utils::NavigateToURL( 1532 ui_test_utils::NavigateToURL(
1533 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + 1533 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") +
1534 kHttp09Response)); 1534 kHttp09Response));
1535 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); 1535 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response));
1536 } 1536 }
1537 1537
1538 } // namespace 1538 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698