OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 namespace views { | 43 namespace views { |
44 | 44 |
45 class TextfieldModelTest : public ViewsTestBase, | 45 class TextfieldModelTest : public ViewsTestBase, |
46 public TextfieldModel::Delegate { | 46 public TextfieldModel::Delegate { |
47 public: | 47 public: |
48 TextfieldModelTest() | 48 TextfieldModelTest() |
49 : ViewsTestBase(), | 49 : ViewsTestBase(), |
50 composition_text_confirmed_or_cleared_(false) { | 50 composition_text_confirmed_or_cleared_(false) { |
51 } | 51 } |
52 | 52 |
53 virtual void OnCompositionTextConfirmedOrCleared() OVERRIDE { | 53 virtual void OnCompositionTextConfirmedOrCleared() override { |
54 composition_text_confirmed_or_cleared_ = true; | 54 composition_text_confirmed_or_cleared_ = true; |
55 } | 55 } |
56 | 56 |
57 protected: | 57 protected: |
58 void ResetModel(TextfieldModel* model) const { | 58 void ResetModel(TextfieldModel* model) const { |
59 model->SetText(base::string16()); | 59 model->SetText(base::string16()); |
60 model->ClearEditHistory(); | 60 model->ClearEditHistory(); |
61 } | 61 } |
62 | 62 |
63 bool composition_text_confirmed_or_cleared_; | 63 bool composition_text_confirmed_or_cleared_; |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 EXPECT_TRUE(model.Undo()); | 1473 EXPECT_TRUE(model.Undo()); |
1474 EXPECT_STR_EQ("ABCDE", model.text()); | 1474 EXPECT_STR_EQ("ABCDE", model.text()); |
1475 EXPECT_TRUE(model.Redo()); | 1475 EXPECT_TRUE(model.Redo()); |
1476 EXPECT_STR_EQ("1234", model.text()); | 1476 EXPECT_STR_EQ("1234", model.text()); |
1477 EXPECT_FALSE(model.Redo()); | 1477 EXPECT_FALSE(model.Redo()); |
1478 | 1478 |
1479 // TODO(oshima): Test the behavior with an IME. | 1479 // TODO(oshima): Test the behavior with an IME. |
1480 } | 1480 } |
1481 | 1481 |
1482 } // namespace views | 1482 } // namespace views |
OLD | NEW |