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

Unified Diff: blimp/engine/feature/engine_settings_feature_unittest.cc

Issue 1810213009: blimp: Add settings to allow the client to download the whole page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@record_full_document
Patch Set: Use ContentBrowserClient to override prefs. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/engine/feature/engine_settings_feature.cc ('k') | blimp/engine/session/blimp_engine_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/feature/engine_settings_feature_unittest.cc
diff --git a/blimp/engine/feature/engine_settings_feature_unittest.cc b/blimp/engine/feature/engine_settings_feature_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..94c78ca42b5c4431d93646543fb4a263e3345541
--- /dev/null
+++ b/blimp/engine/feature/engine_settings_feature_unittest.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/engine/feature/engine_settings_feature.h"
+
+#include "blimp/common/create_blimp_message.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/common/proto/settings.pb.h"
+#include "blimp/engine/app/settings_manager.h"
+#include "net/base/test_completion_callback.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blimp {
+namespace engine {
+
+namespace {
+
+class EngineSettingsFeatureTest : public testing::Test {
+ public:
+ EngineSettingsFeatureTest() : feature_(&settings_manager_) {}
+
+ protected:
+ SettingsManager settings_manager_;
+ EngineSettingsFeature feature_;
+};
+
+TEST_F(EngineSettingsFeatureTest, UpdatesSettingsCorrectly) {
+ EXPECT_FALSE(settings_manager_.GetEngineSettings().record_whole_document);
+
+ EngineSettingsMessage* engine_settings;
+ scoped_ptr<BlimpMessage> message = CreateBlimpMessage(&engine_settings);
+ engine_settings->set_record_whole_document(true);
+
+ net::TestCompletionCallback cb;
+ feature_.ProcessMessage(std::move(message), cb.callback());
+
+ EXPECT_TRUE(settings_manager_.GetEngineSettings().record_whole_document);
+}
+
+} // namespace
+
+} // namespace engine
+} // namespace blimp
« no previous file with comments | « blimp/engine/feature/engine_settings_feature.cc ('k') | blimp/engine/session/blimp_engine_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698