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

Side by Side Diff: chrome/browser/chromeos/login/users/avatar/user_image_manager_browsertest.cc

Issue 2737733003: Add Active Directory login UI tests (Closed)
Patch Set: Rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/login/users/avatar/user_image_manager.h" 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 ->SetOwnerKeyUtilForTesting(owner_key_util_); 589 ->SetOwnerKeyUtilForTesting(owner_key_util_);
590 owner_key_util_->SetPublicKeyFromPrivateKey( 590 owner_key_util_->SetPublicKeyFromPrivateKey(
591 *device_policy_.GetSigningKey()); 591 *device_policy_.GetSigningKey());
592 fake_session_manager_client_->set_device_policy(device_policy_.GetBlob()); 592 fake_session_manager_client_->set_device_policy(device_policy_.GetBlob());
593 DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( 593 DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient(
594 std::unique_ptr<SessionManagerClient>(fake_session_manager_client_)); 594 std::unique_ptr<SessionManagerClient>(fake_session_manager_client_));
595 595
596 // Set up fake install attributes. 596 // Set up fake install attributes.
597 std::unique_ptr<chromeos::StubInstallAttributes> attributes = 597 std::unique_ptr<chromeos::StubInstallAttributes> attributes =
598 base::MakeUnique<chromeos::StubInstallAttributes>(); 598 base::MakeUnique<chromeos::StubInstallAttributes>();
599 attributes->SetEnterprise("fake-domain", "fake-id"); 599 attributes->SetCloudManaged("fake-domain", "fake-id");
600 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting( 600 policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
601 attributes.release()); 601 attributes.release());
602 UserImageManagerTest::SetUpInProcessBrowserTestFixture(); 602 UserImageManagerTest::SetUpInProcessBrowserTestFixture();
603 } 603 }
604 604
605 void SetUpOnMainThread() override { 605 void SetUpOnMainThread() override {
606 UserImageManagerTest::SetUpOnMainThread(); 606 UserImageManagerTest::SetUpOnMainThread();
607 607
608 base::FilePath user_keys_dir; 608 base::FilePath user_keys_dir;
609 ASSERT_TRUE(PathService::Get(chromeos::DIR_USER_POLICY_KEYS, 609 ASSERT_TRUE(PathService::Get(chromeos::DIR_USER_POLICY_KEYS,
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 saved_image = 884 saved_image =
885 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load(); 885 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load();
886 ASSERT_TRUE(saved_image); 886 ASSERT_TRUE(saved_image);
887 887
888 // Check image dimensions. Images can't be compared since JPEG is lossy. 888 // Check image dimensions. Images can't be compared since JPEG is lossy.
889 EXPECT_EQ(policy_image_->width(), saved_image->width()); 889 EXPECT_EQ(policy_image_->width(), saved_image->width());
890 EXPECT_EQ(policy_image_->height(), saved_image->height()); 890 EXPECT_EQ(policy_image_->height(), saved_image->height());
891 } 891 }
892 892
893 } // namespace chromeos 893 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698