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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3116 | 3116 |
3117 #if defined(OS_ANDROID) || defined(TOOLKIT_GTK) | 3117 #if defined(OS_ANDROID) || defined(TOOLKIT_GTK) |
3118 // OS_ANDROID defines an external delegate, but prerequisites for | 3118 // OS_ANDROID defines an external delegate, but prerequisites for |
3119 // landing autofill_external_delegate_android.cc in the Chromium tree | 3119 // landing autofill_external_delegate_android.cc in the Chromium tree |
3120 // have not themselves landed. | 3120 // have not themselves landed. |
3121 | 3121 |
3122 // Turn on the external delegate. Recreate a WebContents. Make sure | 3122 // Turn on the external delegate. Recreate a WebContents. Make sure |
3123 // an external delegate was set in the proper structures. | 3123 // an external delegate was set in the proper structures. |
3124 TEST_F(AutofillManagerTest, TestTabContentsWithExternalDelegate) { | 3124 TEST_F(AutofillManagerTest, TestTabContentsWithExternalDelegate) { |
3125 CommandLine::ForCurrentProcess()->AppendSwitch( | 3125 CommandLine::ForCurrentProcess()->AppendSwitch( |
3126 switches::kExternalAutofillPopup); | 3126 switches::kEnableNewAutofillUi); |
3127 | 3127 |
3128 // Setting the contents creates a new TabContents. | 3128 // Setting the contents creates a new TabContents. |
3129 WebContents* contents = CreateTestWebContents(); | 3129 WebContents* contents = CreateTestWebContents(); |
3130 SetContents(contents); | 3130 SetContents(contents); |
3131 | 3131 |
3132 AutofillManager* autofill_manager = | 3132 AutofillManager* autofill_manager = |
3133 AutofillManager::FromWebContents(contents); | 3133 AutofillManager::FromWebContents(contents); |
3134 EXPECT_TRUE(autofill_manager->external_delegate()); | 3134 EXPECT_TRUE(autofill_manager->external_delegate()); |
3135 | 3135 |
3136 AutocompleteHistoryManager* autocomplete_history_manager = | 3136 AutocompleteHistoryManager* autocomplete_history_manager = |
3137 AutocompleteHistoryManager::FromWebContents(contents); | 3137 AutocompleteHistoryManager::FromWebContents(contents); |
3138 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); | 3138 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); |
3139 } | 3139 } |
3140 | 3140 |
3141 #endif // OS_ANDROID | 3141 #endif // OS_ANDROID |
OLD | NEW |