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

Side by Side Diff: apps/moterm/moterm_model_unittest.cc

Issue 1322103006: Moterm: Plumb responses back to the terminal File. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "apps/moterm/moterm_model.h" 5 #include "apps/moterm/moterm_model.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 EXPECT_FALSE(state_changes.IsDirty()); 124 EXPECT_FALSE(state_changes.IsDirty());
125 125
126 state_changes.dirty_rect = MotermModel::Rectangle(1, 2, 34, 56); 126 state_changes.dirty_rect = MotermModel::Rectangle(1, 2, 34, 56);
127 EXPECT_TRUE(state_changes.IsDirty()); 127 EXPECT_TRUE(state_changes.IsDirty());
128 state_changes.Reset(); 128 state_changes.Reset();
129 EXPECT_TRUE(state_changes.dirty_rect.IsEmpty()); 129 EXPECT_TRUE(state_changes.dirty_rect.IsEmpty());
130 EXPECT_FALSE(state_changes.IsDirty()); 130 EXPECT_FALSE(state_changes.IsDirty());
131 } 131 }
132 132
133 TEST(MotermModelTest, Basic) { 133 TEST(MotermModelTest, Basic) {
134 MotermModel model(MotermModel::Size(43, 132), MotermModel::Size(25, 80)); 134 MotermModel model(MotermModel::Size(43, 132), MotermModel::Size(25, 80),
135 nullptr);
135 136
136 MotermModel::Size size = model.GetSize(); 137 MotermModel::Size size = model.GetSize();
137 EXPECT_EQ(25u, size.rows); 138 EXPECT_EQ(25u, size.rows);
138 EXPECT_EQ(80u, size.columns); 139 EXPECT_EQ(80u, size.columns);
139 140
140 // The cursor should start out at the upper-left. 141 // The cursor should start out at the upper-left.
141 MotermModel::Position cursor_pos = model.GetCursorPosition(); 142 MotermModel::Position cursor_pos = model.GetCursorPosition();
142 EXPECT_EQ(0, cursor_pos.row); 143 EXPECT_EQ(0, cursor_pos.row);
143 EXPECT_EQ(0, cursor_pos.column); 144 EXPECT_EQ(0, cursor_pos.column);
144 145
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 size = model.GetSize(); 194 size = model.GetSize();
194 EXPECT_EQ(43u, size.rows); 195 EXPECT_EQ(43u, size.rows);
195 EXPECT_EQ(132u, size.columns); 196 EXPECT_EQ(132u, size.columns);
196 197
197 model.SetSize(MotermModel::Size(40, 100), true); 198 model.SetSize(MotermModel::Size(40, 100), true);
198 size = model.GetSize(); 199 size = model.GetSize();
199 EXPECT_EQ(40u, size.rows); 200 EXPECT_EQ(40u, size.rows);
200 EXPECT_EQ(100u, size.columns); 201 EXPECT_EQ(100u, size.columns);
201 } 202 }
202 203
204 // TODO(vtl): Test responses.
205
203 } // namespace 206 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698