| OLD | NEW |
| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 6 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 7 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 7 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| 8 #include "chrome/test/testing_profile.h" | 8 #include "chrome/test/testing_profile.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual bool OnAfterPossibleChange() { return false; } | 55 virtual bool OnAfterPossibleChange() { return false; } |
| 56 virtual gfx::NativeView GetNativeView() const { return 0; } | 56 virtual gfx::NativeView GetNativeView() const { return 0; } |
| 57 virtual CommandUpdater* GetCommandUpdater() { return NULL; } | 57 virtual CommandUpdater* GetCommandUpdater() { return NULL; } |
| 58 virtual void SetInstantSuggestion(const string16& input) {} | 58 virtual void SetInstantSuggestion(const string16& input) {} |
| 59 virtual string16 GetInstantSuggestion() const { return string16(); } | 59 virtual string16 GetInstantSuggestion() const { return string16(); } |
| 60 virtual int TextWidth() const { return 0; } | 60 virtual int TextWidth() const { return 0; } |
| 61 virtual bool IsImeComposing() const { return false; } | 61 virtual bool IsImeComposing() const { return false; } |
| 62 | 62 |
| 63 #if defined(TOOLKIT_VIEWS) | 63 #if defined(TOOLKIT_VIEWS) |
| 64 virtual views::View* AddToView(views::View* parent) { return NULL; } | 64 virtual views::View* AddToView(views::View* parent) { return NULL; } |
| 65 virtual int OnPerformDrop(const views::DropTargetEvent& event) { return 0; } |
| 65 #endif | 66 #endif |
| 66 | 67 |
| 67 private: | 68 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditView); | 69 DISALLOW_COPY_AND_ASSIGN(TestingAutocompleteEditView); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 class TestingAutocompleteEditController : public AutocompleteEditController { | 72 class TestingAutocompleteEditController : public AutocompleteEditController { |
| 72 public: | 73 public: |
| 73 TestingAutocompleteEditController() {} | 74 TestingAutocompleteEditController() {} |
| 74 virtual void OnAutocompleteWillClosePopup() {} | 75 virtual void OnAutocompleteWillClosePopup() {} |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 GURL url; | 153 GURL url; |
| 153 bool write_url; | 154 bool write_url; |
| 154 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected, | 155 model.AdjustTextForCopy(input[i].sel_start, input[i].is_all_selected, |
| 155 &result, &url, &write_url); | 156 &result, &url, &write_url); |
| 156 EXPECT_EQ(ASCIIToUTF16(input[i].expected_output), result) << "@: " << i; | 157 EXPECT_EQ(ASCIIToUTF16(input[i].expected_output), result) << "@: " << i; |
| 157 EXPECT_EQ(input[i].write_url, write_url) << " @" << i; | 158 EXPECT_EQ(input[i].write_url, write_url) << " @" << i; |
| 158 if (write_url) | 159 if (write_url) |
| 159 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i; | 160 EXPECT_EQ(input[i].expected_url, url.spec()) << " @" << i; |
| 160 } | 161 } |
| 161 } | 162 } |
| OLD | NEW |