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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_unittest.cc

Issue 6252003: Accept keyword by pressing space. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/autocomplete/autocomplete_edit.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit.h"
6 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" 6 #include "chrome/browser/autocomplete/autocomplete_edit_view.h"
7 #include "chrome/test/testing_profile.h" 7 #include "chrome/test/testing_profile.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 WindowOpenDisposition disposition, 87 WindowOpenDisposition disposition,
88 PageTransition::Type transition, 88 PageTransition::Type transition,
89 const GURL& alternate_nav_url) {} 89 const GURL& alternate_nav_url) {}
90 virtual void OnChanged() {} 90 virtual void OnChanged() {}
91 virtual void OnSelectionBoundsChanged() {} 91 virtual void OnSelectionBoundsChanged() {}
92 virtual void OnInputInProgress(bool in_progress) {} 92 virtual void OnInputInProgress(bool in_progress) {}
93 virtual void OnKillFocus() {} 93 virtual void OnKillFocus() {}
94 virtual void OnSetFocus() {} 94 virtual void OnSetFocus() {}
95 virtual SkBitmap GetFavIcon() const { return SkBitmap(); } 95 virtual SkBitmap GetFavIcon() const { return SkBitmap(); }
96 virtual std::wstring GetTitle() const { return std::wstring(); } 96 virtual std::wstring GetTitle() const { return std::wstring(); }
97 virtual bool IsKeywordHintVisible() const { return false; }
97 98
98 private: 99 private:
99 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditController); 100 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditController);
100 }; 101 };
101 102
102 } 103 }
103 104
104 typedef testing::Test AutocompleteEditTest; 105 typedef testing::Test AutocompleteEditTest;
105 106
106 // Tests various permutations of AutocompleteModel::AdjustTextForCopy. 107 // Tests various permutations of AutocompleteModel::AdjustTextForCopy.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 GURL url; 155 GURL url;
155 bool write_url; 156 bool write_url;
156 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected, 157 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected,
157 &result, &url, &write_url); 158 &result, &url, &write_url);
158 EXPECT_EQ(input[i].expected_output, result) << "@: " << i; 159 EXPECT_EQ(input[i].expected_output, result) << "@: " << i;
159 EXPECT_EQ(input[i].write_url, write_url) << " @" << i; 160 EXPECT_EQ(input[i].write_url, write_url) << " @" << i;
160 if (write_url) 161 if (write_url)
161 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i; 162 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i;
162 } 163 }
163 } 164 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698