| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |