| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 command_line->AppendSwitch(autofill::switches::kEnablePasswordGeneration); | 55 command_line->AppendSwitch(autofill::switches::kEnablePasswordGeneration); |
| 56 | 56 |
| 57 // Don't require ping from autofill or blacklist checking. | 57 // Don't require ping from autofill or blacklist checking. |
| 58 command_line->AppendSwitch( | 58 command_line->AppendSwitch( |
| 59 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); | 59 autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void SetUpOnMainThread() OVERRIDE { | 62 virtual void SetUpOnMainThread() OVERRIDE { |
| 63 // Disable Autofill requesting access to AddressBook data. This will cause | 63 // Disable Autofill requesting access to AddressBook data. This will cause |
| 64 // the tests to hang on Mac. | 64 // the tests to hang on Mac. |
| 65 autofill::test::DisableSystemServices(browser()->profile()); | 65 autofill::test::DisableSystemServices(browser()->profile()->GetPrefs()); |
| 66 | 66 |
| 67 // Set observer for popup. | 67 // Set observer for popup. |
| 68 ChromePasswordManagerClient* client = | 68 ChromePasswordManagerClient* client = |
| 69 ChromePasswordManagerClient::FromWebContents(GetWebContents()); | 69 ChromePasswordManagerClient::FromWebContents(GetWebContents()); |
| 70 client->SetTestObserver(&observer_); | 70 client->SetTestObserver(&observer_); |
| 71 | 71 |
| 72 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 72 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 73 GURL url = embedded_test_server()->GetURL("/password/signup_form.html"); | 73 GURL url = embedded_test_server()->GetURL("/password/signup_form.html"); |
| 74 ui_test_utils::NavigateToURL(browser(), url); | 74 ui_test_utils::NavigateToURL(browser(), url); |
| 75 } | 75 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 IN_PROC_BROWSER_TEST_F(PasswordGenerationInteractiveTest, | 166 IN_PROC_BROWSER_TEST_F(PasswordGenerationInteractiveTest, |
| 167 MAYBE_PopupShownAndDismissed) { | 167 MAYBE_PopupShownAndDismissed) { |
| 168 FocusPasswordField(); | 168 FocusPasswordField(); |
| 169 EXPECT_TRUE(GenerationPopupShowing()); | 169 EXPECT_TRUE(GenerationPopupShowing()); |
| 170 | 170 |
| 171 SendKeyToPopup(ui::VKEY_ESCAPE); | 171 SendKeyToPopup(ui::VKEY_ESCAPE); |
| 172 | 172 |
| 173 // Popup is dismissed. | 173 // Popup is dismissed. |
| 174 EXPECT_FALSE(GenerationPopupShowing()); | 174 EXPECT_FALSE(GenerationPopupShowing()); |
| 175 } | 175 } |
| OLD | NEW |