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

Side by Side Diff: chrome/browser/password_manager/password_manager_test_base.cc

Issue 1488763003: [Password Manager] Switch password manager code to use "base/feature_list.h". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses nit. Created 5 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/password_manager/password_manager_test_base.h" 5 #include "chrome/browser/password_manager/password_manager_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "chrome/browser/infobars/infobar_service.h" 12 #include "chrome/browser/infobars/infobar_service.h"
13 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 13 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
14 #include "chrome/browser/password_manager/password_store_factory.h" 14 #include "chrome/browser/password_manager/password_store_factory.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" 17 #include "chrome/browser/ui/passwords/passwords_model_delegate.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 18 #include "chrome/browser/ui/tabs/tab_strip_model.h"
19 #include "chrome/test/base/ui_test_utils.h" 19 #include "chrome/test/base/ui_test_utils.h"
20 #include "components/autofill/core/browser/autofill_test_utils.h" 20 #include "components/autofill/core/browser/autofill_test_utils.h"
21 #include "components/infobars/core/confirm_infobar_delegate.h" 21 #include "components/infobars/core/confirm_infobar_delegate.h"
22 #include "components/infobars/core/infobar.h" 22 #include "components/infobars/core/infobar.h"
23 #include "components/infobars/core/infobar_manager.h" 23 #include "components/infobars/core/infobar_manager.h"
24 #include "components/password_manager/core/browser/password_manager_test_utils.h " 24 #include "components/password_manager/core/browser/password_manager_test_utils.h "
25 #include "components/password_manager/core/browser/test_password_store.h" 25 #include "components/password_manager/core/browser/test_password_store.h"
26 #include "components/password_manager/core/common/password_manager_features.h"
26 #include "components/password_manager/core/common/password_manager_switches.h" 27 #include "components/password_manager/core/common/password_manager_switches.h"
27 #include "content/public/browser/render_frame_host.h" 28 #include "content/public/browser/render_frame_host.h"
28 #include "content/public/test/browser_test_utils.h" 29 #include "content/public/test/browser_test_utils.h"
29 #include "content/public/test/test_utils.h" 30 #include "content/public/test/test_utils.h"
30 #include "net/test/embedded_test_server/embedded_test_server.h" 31 #include "net/test/embedded_test_server/embedded_test_server.h"
31 32
32 NavigationObserver::NavigationObserver(content::WebContents* web_contents) 33 NavigationObserver::NavigationObserver(content::WebContents* web_contents)
33 : content::WebContentsObserver(web_contents), 34 : content::WebContentsObserver(web_contents),
34 quit_on_entry_committed_(false), 35 quit_on_entry_committed_(false),
35 message_loop_runner_(new content::MessageLoopRunner) { 36 message_loop_runner_(new content::MessageLoopRunner) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Use TestPasswordStore to remove a possible race. Normally the 189 // Use TestPasswordStore to remove a possible race. Normally the
189 // PasswordStore does its database manipulation on the DB thread, which 190 // PasswordStore does its database manipulation on the DB thread, which
190 // creates a possible race during navigation. Specifically the 191 // creates a possible race during navigation. Specifically the
191 // PasswordManager will ignore any forms in a page if the load from the 192 // PasswordManager will ignore any forms in a page if the load from the
192 // PasswordStore has not completed. 193 // PasswordStore has not completed.
193 PasswordStoreFactory::GetInstance()->SetTestingFactory( 194 PasswordStoreFactory::GetInstance()->SetTestingFactory(
194 browser()->profile(), 195 browser()->profile(),
195 password_manager::BuildPasswordStore< 196 password_manager::BuildPasswordStore<
196 content::BrowserContext, password_manager::TestPasswordStore>); 197 content::BrowserContext, password_manager::TestPasswordStore>);
197 ASSERT_TRUE(embedded_test_server()->Start()); 198 ASSERT_TRUE(embedded_test_server()->Start());
198 ASSERT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch( 199 ASSERT_FALSE(base::FeatureList::IsEnabled(
199 password_manager::switches::kEnableAutomaticPasswordSaving)); 200 password_manager::features::kEnableAutomaticPasswordSaving));
200 } 201 }
201 202
202 void PasswordManagerBrowserTestBase::TearDownOnMainThread() { 203 void PasswordManagerBrowserTestBase::TearDownOnMainThread() {
203 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); 204 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
204 } 205 }
205 206
206 content::WebContents* PasswordManagerBrowserTestBase::WebContents() { 207 content::WebContents* PasswordManagerBrowserTestBase::WebContents() {
207 return browser()->tab_strip_model()->GetActiveWebContents(); 208 return browser()->tab_strip_model()->GetActiveWebContents();
208 } 209 }
209 210
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 " var element = document.getElementById('%s');" 336 " var element = document.getElementById('%s');"
336 "window.domAutomationController.send(element && element.value == '%s');", 337 "window.domAutomationController.send(element && element.value == '%s');",
337 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(), 338 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(),
338 element_id.c_str(), expected_value.c_str()); 339 element_id.c_str(), expected_value.c_str());
339 bool return_value = false; 340 bool return_value = false;
340 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 341 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
341 RenderViewHost(), value_check_script, &return_value)); 342 RenderViewHost(), value_check_script, &return_value));
342 EXPECT_TRUE(return_value) << "element_id = " << element_id 343 EXPECT_TRUE(return_value) << "element_id = " << element_id
343 << ", expected_value = " << expected_value; 344 << ", expected_value = " << expected_value;
344 } 345 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | components/password_manager.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698