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

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

Issue 6036004: Refactor AutocompleteEditViewGtk so that AutocompleteEditView impl can be swapped. (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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual bool OnInlineAutocompleteTextMaybeChanged( 48 virtual bool OnInlineAutocompleteTextMaybeChanged(
49 const std::wstring& display_text, size_t user_text_length) { 49 const std::wstring& display_text, size_t user_text_length) {
50 return false; 50 return false;
51 } 51 }
52 virtual void OnRevertTemporaryText() {} 52 virtual void OnRevertTemporaryText() {}
53 virtual void OnBeforePossibleChange() {} 53 virtual void OnBeforePossibleChange() {}
54 virtual bool OnAfterPossibleChange() { return false; } 54 virtual bool OnAfterPossibleChange() { return false; }
55 virtual gfx::NativeView GetNativeView() const { return 0; } 55 virtual gfx::NativeView GetNativeView() const { return 0; }
56 virtual CommandUpdater* GetCommandUpdater() { return NULL; } 56 virtual CommandUpdater* GetCommandUpdater() { return NULL; }
57 57
58 #if defined(TOOLKIT_VIEWS)
59 virtual views::View* AddToView(views::View* parent) { return NULL; }
60 virtual int TextWidth() const { return 0; }
61 virtual bool CommitInstantSuggestion(
62 const std::wstring& typed_text,
63 const std::wstring& suggested_text) { return false;}
64 virtual void SetInstantSuggestion(const string16& input) {}
65 #endif
66
58 private: 67 private:
59 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditView); 68 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditView);
60 }; 69 };
61 70
62 class TestingAutocompleteEditController : public AutocompleteEditController { 71 class TestingAutocompleteEditController : public AutocompleteEditController {
63 public: 72 public:
64 TestingAutocompleteEditController() {} 73 TestingAutocompleteEditController() {}
65 virtual void OnAutocompleteWillClosePopup() {} 74 virtual void OnAutocompleteWillClosePopup() {}
66 virtual void OnAutocompleteLosingFocus(gfx::NativeView view_gaining_focus) {} 75 virtual void OnAutocompleteLosingFocus(gfx::NativeView view_gaining_focus) {}
67 virtual void OnAutocompleteWillAccept() {} 76 virtual void OnAutocompleteWillAccept() {}
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 GURL url; 153 GURL url;
145 bool write_url; 154 bool write_url;
146 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected, 155 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected,
147 &result, &url, &write_url); 156 &result, &url, &write_url);
148 EXPECT_EQ(input[i].expected_output, result) << "@: " << i; 157 EXPECT_EQ(input[i].expected_output, result) << "@: " << i;
149 EXPECT_EQ(input[i].write_url, write_url) << " @" << i; 158 EXPECT_EQ(input[i].write_url, write_url) << " @" << i;
150 if (write_url) 159 if (write_url)
151 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i; 160 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i;
152 } 161 }
153 } 162 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698