| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // creates a possible race during navigation. Specifically the | 256 // creates a possible race during navigation. Specifically the |
| 257 // PasswordManager will ignore any forms in a page if the load from the | 257 // PasswordManager will ignore any forms in a page if the load from the |
| 258 // PasswordStore has not completed. | 258 // PasswordStore has not completed. |
| 259 PasswordStoreFactory::GetInstance()->SetTestingFactory( | 259 PasswordStoreFactory::GetInstance()->SetTestingFactory( |
| 260 browser()->profile(), TestPasswordStoreService::Build); | 260 browser()->profile(), TestPasswordStoreService::Build); |
| 261 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 261 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 262 ASSERT_FALSE(CommandLine::ForCurrentProcess()->HasSwitch( | 262 ASSERT_FALSE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 263 password_manager::switches::kEnableAutomaticPasswordSaving)); | 263 password_manager::switches::kEnableAutomaticPasswordSaving)); |
| 264 } | 264 } |
| 265 | 265 |
| 266 virtual void CleanUpOnMainThread() OVERRIDE { | 266 virtual void TearDownOnMainThread() OVERRIDE { |
| 267 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | 267 ASSERT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); |
| 268 InProcessBrowserTest::CleanUpOnMainThread(); | |
| 269 } | 268 } |
| 270 | 269 |
| 271 protected: | 270 protected: |
| 272 content::WebContents* WebContents() { | 271 content::WebContents* WebContents() { |
| 273 return browser()->tab_strip_model()->GetActiveWebContents(); | 272 return browser()->tab_strip_model()->GetActiveWebContents(); |
| 274 } | 273 } |
| 275 | 274 |
| 276 content::RenderViewHost* RenderViewHost() { | 275 content::RenderViewHost* RenderViewHost() { |
| 277 return WebContents()->GetRenderViewHost(); | 276 return WebContents()->GetRenderViewHost(); |
| 278 } | 277 } |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 std::string submit = | 1112 std::string submit = |
| 1114 "document.getElementById('username').value = 'overwrite_me';" | 1113 "document.getElementById('username').value = 'overwrite_me';" |
| 1115 "document.getElementById('password').value = 'random';" | 1114 "document.getElementById('password').value = 'random';" |
| 1116 "document.getElementById('non-form-button').click();"; | 1115 "document.getElementById('non-form-button').click();"; |
| 1117 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); | 1116 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); |
| 1118 observer.Wait(); | 1117 observer.Wait(); |
| 1119 | 1118 |
| 1120 EXPECT_TRUE(prompt_observer->IsShowingPrompt()); | 1119 EXPECT_TRUE(prompt_observer->IsShowingPrompt()); |
| 1121 } | 1120 } |
| 1122 | 1121 |
| OLD | NEW |