OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 6 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" | 8 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 private: | 42 private: |
43 bool popup_showing_; | 43 bool popup_showing_; |
44 bool password_visible_; | 44 bool password_visible_; |
45 }; | 45 }; |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 class PasswordGenerationInteractiveTest : public InProcessBrowserTest { | 49 class PasswordGenerationInteractiveTest : public InProcessBrowserTest { |
50 public: | 50 public: |
51 void SetUpCommandLine(CommandLine* command_line) override { | 51 void SetUpCommandLine(base::CommandLine* command_line) override { |
52 // Make sure the feature is enabled. | 52 // Make sure the feature is enabled. |
53 command_line->AppendSwitch(autofill::switches::kEnablePasswordGeneration); | 53 command_line->AppendSwitch(autofill::switches::kEnablePasswordGeneration); |
54 | 54 |
55 // Don't require ping from autofill or blacklist checking. | 55 // Don't require ping from autofill or blacklist checking. |
56 command_line->AppendSwitch( | 56 command_line->AppendSwitch( |
57 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); | 57 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); |
58 } | 58 } |
59 | 59 |
60 void SetUpOnMainThread() override { | 60 void SetUpOnMainThread() override { |
61 // Disable Autofill requesting access to AddressBook data. This will cause | 61 // Disable Autofill requesting access to AddressBook data. This will cause |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 IN_PROC_BROWSER_TEST_F(PasswordGenerationInteractiveTest, | 182 IN_PROC_BROWSER_TEST_F(PasswordGenerationInteractiveTest, |
183 MAYBE_PopupShownAndDismissedByScrolling) { | 183 MAYBE_PopupShownAndDismissedByScrolling) { |
184 FocusPasswordField(); | 184 FocusPasswordField(); |
185 EXPECT_TRUE(GenerationPopupShowing()); | 185 EXPECT_TRUE(GenerationPopupShowing()); |
186 | 186 |
187 ASSERT_TRUE(content::ExecuteScript(GetRenderViewHost(), | 187 ASSERT_TRUE(content::ExecuteScript(GetRenderViewHost(), |
188 "window.scrollTo(100, 0);")); | 188 "window.scrollTo(100, 0);")); |
189 | 189 |
190 EXPECT_FALSE(GenerationPopupShowing()); | 190 EXPECT_FALSE(GenerationPopupShowing()); |
191 } | 191 } |
OLD | NEW |