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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/chromeos/policy/device_local_account.h" 5 #include "chrome/browser/chromeos/policy/device_local_account.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 1413
1414 // Verify that the external data reference has propagated to the device-local 1414 // Verify that the external data reference has propagated to the device-local
1415 // account's ProfilePolicyConnector. 1415 // account's ProfilePolicyConnector.
1416 ProfilePolicyConnector* policy_connector = 1416 ProfilePolicyConnector* policy_connector =
1417 ProfilePolicyConnectorFactory::GetForBrowserContext(GetProfileForTest()); 1417 ProfilePolicyConnectorFactory::GetForBrowserContext(GetProfileForTest());
1418 ASSERT_TRUE(policy_connector); 1418 ASSERT_TRUE(policy_connector);
1419 const PolicyMap& policies = policy_connector->policy_service()->GetPolicies( 1419 const PolicyMap& policies = policy_connector->policy_service()->GetPolicies(
1420 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())); 1420 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
1421 policy_entry = policies.Get(key::kUserAvatarImage); 1421 policy_entry = policies.Get(key::kUserAvatarImage);
1422 ASSERT_TRUE(policy_entry); 1422 ASSERT_TRUE(policy_entry);
1423 EXPECT_TRUE(base::Value::Equals(metadata.get(), policy_entry->value)); 1423 EXPECT_TRUE(base::Value::Equals(metadata.get(), policy_entry->value.get()));
1424 ASSERT_TRUE(policy_entry->external_data_fetcher); 1424 ASSERT_TRUE(policy_entry->external_data_fetcher);
1425 1425
1426 // Retrieve the external data via the ProfilePolicyConnector. The retrieval 1426 // Retrieve the external data via the ProfilePolicyConnector. The retrieval
1427 // should succeed because the data has been cached. 1427 // should succeed because the data has been cached.
1428 run_loop.reset(new base::RunLoop); 1428 run_loop.reset(new base::RunLoop);
1429 fetched_external_data.reset(); 1429 fetched_external_data.reset();
1430 policy_entry->external_data_fetcher->Fetch(base::Bind( 1430 policy_entry->external_data_fetcher->Fetch(base::Bind(
1431 &test::ExternalDataFetchCallback, 1431 &test::ExternalDataFetchCallback,
1432 &fetched_external_data, 1432 &fetched_external_data,
1433 run_loop->QuitClosure())); 1433 run_loop->QuitClosure()));
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 ASSERT_TRUE(content::ExecuteScript(contents_, 2444 ASSERT_TRUE(content::ExecuteScript(contents_,
2445 "$('tos-accept-button').click();")); 2445 "$('tos-accept-button').click();"));
2446 2446
2447 WaitForSessionStart(); 2447 WaitForSessionStart();
2448 } 2448 }
2449 2449
2450 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, 2450 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance,
2451 TermsOfServiceDownloadTest, testing::Bool()); 2451 TermsOfServiceDownloadTest, testing::Bool());
2452 2452
2453 } // namespace policy 2453 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698