OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 class TestingOmniboxEditController : public OmniboxEditController { | 107 class TestingOmniboxEditController : public OmniboxEditController { |
108 public: | 108 public: |
109 explicit TestingOmniboxEditController(ToolbarModel* toolbar_model) | 109 explicit TestingOmniboxEditController(ToolbarModel* toolbar_model) |
110 : toolbar_model_(toolbar_model) {} | 110 : toolbar_model_(toolbar_model) {} |
111 | 111 |
112 protected: | 112 protected: |
113 // OmniboxEditController: | 113 // OmniboxEditController: |
114 void OnInputInProgress(bool in_progress) override {} | 114 void OnInputInProgress(bool in_progress) override {} |
115 void OnChanged() override {} | 115 void OnChanged() override {} |
116 void OnSetFocus() override {} | |
117 void ShowURL() override {} | 116 void ShowURL() override {} |
118 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } | 117 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } |
119 const ToolbarModel* GetToolbarModel() const override { | 118 const ToolbarModel* GetToolbarModel() const override { |
120 return toolbar_model_; | 119 return toolbar_model_; |
121 } | 120 } |
122 | 121 |
123 private: | 122 private: |
124 ToolbarModel* toolbar_model_; | 123 ToolbarModel* toolbar_model_; |
125 | 124 |
126 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxEditController); | 125 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxEditController); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 358 |
360 model.SetUserText(UTF8ToUTF16("he")); | 359 model.SetUserText(UTF8ToUTF16("he")); |
361 model.OnPopupDataChanged(UTF8ToUTF16("llo"), NULL, base::string16(), false); | 360 model.OnPopupDataChanged(UTF8ToUTF16("llo"), NULL, base::string16(), false); |
362 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); | 361 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); |
363 EXPECT_EQ(UTF8ToUTF16("llo"), view.inline_autocomplete_text()); | 362 EXPECT_EQ(UTF8ToUTF16("llo"), view.inline_autocomplete_text()); |
364 | 363 |
365 model.AcceptTemporaryTextAsUserText(); | 364 model.AcceptTemporaryTextAsUserText(); |
366 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); | 365 EXPECT_EQ(UTF8ToUTF16("hello"), view.GetText()); |
367 EXPECT_EQ(base::string16(), view.inline_autocomplete_text()); | 366 EXPECT_EQ(base::string16(), view.inline_autocomplete_text()); |
368 } | 367 } |
OLD | NEW |