OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "blimp/engine/feature/engine_settings_feature.h" | |
6 | |
7 #include "blimp/common/create_blimp_message.h" | |
8 #include "blimp/common/proto/blimp_message.pb.h" | |
9 #include "blimp/common/proto/settings.pb.h" | |
10 #include "blimp/engine/app/settings_manager.h" | |
11 #include "net/base/test_completion_callback.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | |
13 | |
14 namespace blimp { | |
15 namespace engine { | |
16 | |
17 namespace { | |
18 | |
19 class EngineSettingsFeatureTest : public testing::Test { | |
20 public: | |
21 EngineSettingsFeatureTest() : feature_(&settings_manager_) {} | |
22 | |
23 protected: | |
24 SettingsManager settings_manager_; | |
25 EngineSettingsFeature feature_; | |
26 }; | |
27 | |
28 TEST_F(EngineSettingsFeatureTest, UpdatesSettingsCorrectly) { | |
29 EXPECT_FALSE(settings_manager_.GetEngineSettings().record_whole_document); | |
30 | |
31 EngineSettingsMessage* engine_settings; | |
32 std::unique_ptr<BlimpMessage> message = CreateBlimpMessage(&engine_settings); | |
33 engine_settings->set_record_whole_document(true); | |
34 | |
35 net::TestCompletionCallback cb; | |
36 feature_.ProcessMessage(std::move(message), cb.callback()); | |
37 | |
38 EXPECT_TRUE(settings_manager_.GetEngineSettings().record_whole_document); | |
39 } | |
40 | |
41 } // namespace | |
42 | |
43 } // namespace engine | |
44 } // namespace blimp | |
OLD | NEW |