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

Side by Side Diff: blimp/engine/app/settings_manager_unittest.cc

Issue 1903873003: blimp: Update animation policy for images on the blimp engine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove EngineSettings cc file. Created 4 years, 8 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
« no previous file with comments | « blimp/engine/app/settings_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "blimp/engine/app/settings_manager.h" 5 #include "blimp/engine/app/settings_manager.h"
6 6
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blimp { 10 namespace blimp {
(...skipping 22 matching lines...) Expand all
33 TEST_F(SettingsManagerTest, InformsObserversCorrectly) { 33 TEST_F(SettingsManagerTest, InformsObserversCorrectly) {
34 EngineSettings settings = settings_manager_.GetEngineSettings(); 34 EngineSettings settings = settings_manager_.GetEngineSettings();
35 EXPECT_FALSE(settings.record_whole_document); 35 EXPECT_FALSE(settings.record_whole_document);
36 36
37 EXPECT_CALL(observer_, OnWebPreferencesChanged()).Times(1); 37 EXPECT_CALL(observer_, OnWebPreferencesChanged()).Times(1);
38 38
39 settings.record_whole_document = true; 39 settings.record_whole_document = true;
40 settings_manager_.UpdateEngineSettings(settings); 40 settings_manager_.UpdateEngineSettings(settings);
41 } 41 }
42 42
43 TEST_F(SettingsManagerTest, UpdatesSettingsCorrectly) {
44 EngineSettings settings = settings_manager_.GetEngineSettings();
45 EXPECT_FALSE(settings.record_whole_document);
46 EXPECT_EQ(settings.animation_policy,
47 content::ImageAnimationPolicy::IMAGE_ANIMATION_POLICY_NO_ANIMATION);
48
49 settings.record_whole_document = true;
50 settings.animation_policy =
51 content::ImageAnimationPolicy::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE;
52 settings_manager_.UpdateEngineSettings(settings);
53
54 content::WebPreferences prefs;
55 settings_manager_.UpdateWebkitPreferences(&prefs);
56 EXPECT_TRUE(prefs.record_whole_document);
57 EXPECT_EQ(
58 prefs.animation_policy,
59 content::ImageAnimationPolicy::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE);
60 }
61
43 } // namespace 62 } // namespace
44 63
45 } // namespace engine 64 } // namespace engine
46 } // namespace blimp 65 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/app/settings_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698