| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "chrome/test/base/testing_browser_process.h" | 47 #include "chrome/test/base/testing_browser_process.h" |
| 48 #include "chromeos/chromeos_paths.h" | 48 #include "chromeos/chromeos_paths.h" |
| 49 #include "chromeos/chromeos_switches.h" | 49 #include "chromeos/chromeos_switches.h" |
| 50 #include "chromeos/dbus/cryptohome_client.h" | 50 #include "chromeos/dbus/cryptohome_client.h" |
| 51 #include "chromeos/dbus/dbus_thread_manager.h" | 51 #include "chromeos/dbus/dbus_thread_manager.h" |
| 52 #include "chromeos/dbus/fake_session_manager_client.h" | 52 #include "chromeos/dbus/fake_session_manager_client.h" |
| 53 #include "chromeos/dbus/session_manager_client.h" | 53 #include "chromeos/dbus/session_manager_client.h" |
| 54 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 54 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 55 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 55 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 56 #include "components/policy/core/common/cloud/policy_builder.h" | 56 #include "components/policy/core/common/cloud/policy_builder.h" |
| 57 #include "components/policy/proto/cloud_policy.pb.h" |
| 57 #include "components/prefs/pref_change_registrar.h" | 58 #include "components/prefs/pref_change_registrar.h" |
| 58 #include "components/prefs/pref_service.h" | 59 #include "components/prefs/pref_service.h" |
| 59 #include "components/prefs/scoped_user_pref_update.h" | 60 #include "components/prefs/scoped_user_pref_update.h" |
| 60 #include "components/user_manager/user.h" | 61 #include "components/user_manager/user.h" |
| 61 #include "components/user_manager/user_image/user_image.h" | 62 #include "components/user_manager/user_image/user_image.h" |
| 62 #include "components/user_manager/user_manager.h" | 63 #include "components/user_manager/user_manager.h" |
| 63 #include "content/public/browser/notification_service.h" | 64 #include "content/public/browser/notification_service.h" |
| 64 #include "content/public/browser/notification_source.h" | 65 #include "content/public/browser/notification_source.h" |
| 65 #include "content/public/test/test_utils.h" | 66 #include "content/public/test/test_utils.h" |
| 66 #include "crypto/rsa_private_key.h" | 67 #include "crypto/rsa_private_key.h" |
| 67 #include "google_apis/gaia/gaia_oauth_client.h" | 68 #include "google_apis/gaia/gaia_oauth_client.h" |
| 68 #include "google_apis/gaia/oauth2_token_service.h" | 69 #include "google_apis/gaia/oauth2_token_service.h" |
| 69 #include "net/test/embedded_test_server/embedded_test_server.h" | 70 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 70 #include "net/url_request/test_url_fetcher_factory.h" | 71 #include "net/url_request/test_url_fetcher_factory.h" |
| 71 #include "net/url_request/url_fetcher_delegate.h" | 72 #include "net/url_request/url_fetcher_delegate.h" |
| 72 #include "net/url_request/url_request_status.h" | 73 #include "net/url_request/url_request_status.h" |
| 73 #include "policy/proto/cloud_policy.pb.h" | |
| 74 #include "testing/gtest/include/gtest/gtest.h" | 74 #include "testing/gtest/include/gtest/gtest.h" |
| 75 #include "third_party/skia/include/core/SkBitmap.h" | 75 #include "third_party/skia/include/core/SkBitmap.h" |
| 76 #include "ui/base/layout.h" | 76 #include "ui/base/layout.h" |
| 77 #include "ui/base/resource/resource_bundle.h" | 77 #include "ui/base/resource/resource_bundle.h" |
| 78 #include "ui/gfx/image/image_skia.h" | 78 #include "ui/gfx/image/image_skia.h" |
| 79 #include "url/gurl.h" | 79 #include "url/gurl.h" |
| 80 | 80 |
| 81 namespace chromeos { | 81 namespace chromeos { |
| 82 | 82 |
| 83 namespace { | 83 namespace { |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 saved_image = | 816 saved_image = |
| 817 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load(); | 817 test::ImageLoader(GetUserImagePath(enterprise_account_id_, "jpg")).Load(); |
| 818 ASSERT_TRUE(saved_image); | 818 ASSERT_TRUE(saved_image); |
| 819 | 819 |
| 820 // Check image dimensions. Images can't be compared since JPEG is lossy. | 820 // Check image dimensions. Images can't be compared since JPEG is lossy. |
| 821 EXPECT_EQ(policy_image_->width(), saved_image->width()); | 821 EXPECT_EQ(policy_image_->width(), saved_image->width()); |
| 822 EXPECT_EQ(policy_image_->height(), saved_image->height()); | 822 EXPECT_EQ(policy_image_->height(), saved_image->height()); |
| 823 } | 823 } |
| 824 | 824 |
| 825 } // namespace chromeos | 825 } // namespace chromeos |
| OLD | NEW |