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

Side by Side Diff: components/dom_distiller/core/distilled_page_prefs_unittests.cc

Issue 2562733003: Remove duplicated user_prefs::TestingPrefServiceSyncable (Closed)
Patch Set: Fixed usage from .mm files Created 4 years 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 "components/dom_distiller/core/distilled_page_prefs.h" 5 #include "components/dom_distiller/core/distilled_page_prefs.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "components/pref_registry/testing_pref_service_syncable.h" 9 #include "components/sync_preferences/testing_pref_service_syncable.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace dom_distiller { 12 namespace dom_distiller {
13 13
14 namespace { 14 namespace {
15 15
16 class TestingObserver : public DistilledPagePrefs::Observer { 16 class TestingObserver : public DistilledPagePrefs::Observer {
17 public: 17 public:
18 TestingObserver() 18 TestingObserver()
19 : font_(DistilledPagePrefs::SANS_SERIF), 19 : font_(DistilledPagePrefs::SANS_SERIF),
(...skipping 22 matching lines...) Expand all
42 DistilledPagePrefs::FontFamily font_; 42 DistilledPagePrefs::FontFamily font_;
43 DistilledPagePrefs::Theme theme_; 43 DistilledPagePrefs::Theme theme_;
44 float scaling_; 44 float scaling_;
45 }; 45 };
46 46
47 } // namespace 47 } // namespace
48 48
49 class DistilledPagePrefsTest : public testing::Test { 49 class DistilledPagePrefsTest : public testing::Test {
50 protected: 50 protected:
51 void SetUp() override { 51 void SetUp() override {
52 pref_service_.reset(new user_prefs::TestingPrefServiceSyncable()); 52 pref_service_.reset(new sync_preferences::TestingPrefServiceSyncable());
53 DistilledPagePrefs::RegisterProfilePrefs(pref_service_->registry()); 53 DistilledPagePrefs::RegisterProfilePrefs(pref_service_->registry());
54 distilled_page_prefs_.reset(new DistilledPagePrefs(pref_service_.get())); 54 distilled_page_prefs_.reset(new DistilledPagePrefs(pref_service_.get()));
55 } 55 }
56 56
57 std::unique_ptr<user_prefs::TestingPrefServiceSyncable> pref_service_; 57 std::unique_ptr<sync_preferences::TestingPrefServiceSyncable> pref_service_;
58 std::unique_ptr<DistilledPagePrefs> distilled_page_prefs_; 58 std::unique_ptr<DistilledPagePrefs> distilled_page_prefs_;
59 59
60 private: 60 private:
61 base::MessageLoop message_loop_; 61 base::MessageLoop message_loop_;
62 }; 62 };
63 63
64 TEST_F(DistilledPagePrefsTest, TestingOnChangeFontIsBeingCalled) { 64 TEST_F(DistilledPagePrefsTest, TestingOnChangeFontIsBeingCalled) {
65 TestingObserver obs; 65 TestingObserver obs;
66 distilled_page_prefs_->AddObserver(&obs); 66 distilled_page_prefs_->AddObserver(&obs);
67 67
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 distilled_page_prefs_->SetFontScaling(0.9f); 166 distilled_page_prefs_->SetFontScaling(0.9f);
167 base::RunLoop().RunUntilIdle(); 167 base::RunLoop().RunUntilIdle();
168 ASSERT_FLOAT_EQ(1.3f, obs.GetFontScaling()); 168 ASSERT_FLOAT_EQ(1.3f, obs.GetFontScaling());
169 ASSERT_FLOAT_EQ(0.9f, obs2.GetFontScaling()); 169 ASSERT_FLOAT_EQ(0.9f, obs2.GetFontScaling());
170 170
171 distilled_page_prefs_->RemoveObserver(&obs2); 171 distilled_page_prefs_->RemoveObserver(&obs2);
172 } 172 }
173 173
174 } // namespace dom_distiller 174 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/BUILD.gn ('k') | components/dom_distiller/core/dom_distiller_request_view_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698