OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void NavigationObserver::NavigationEntryCommitted( | 50 void NavigationObserver::NavigationEntryCommitted( |
51 const content::LoadCommittedDetails& load_details) { | 51 const content::LoadCommittedDetails& load_details) { |
52 if (quit_on_entry_committed_) | 52 if (quit_on_entry_committed_) |
53 message_loop_runner_->Quit(); | 53 message_loop_runner_->Quit(); |
54 } | 54 } |
55 | 55 |
56 void NavigationObserver::Wait() { | 56 void NavigationObserver::Wait() { |
57 message_loop_runner_->Run(); | 57 message_loop_runner_->Run(); |
58 } | 58 } |
59 | 59 |
| 60 DummyStoreConsumer::DummyStoreConsumer() |
| 61 : message_loop_runner_(new content::MessageLoopRunner) { |
| 62 } |
| 63 |
| 64 DummyStoreConsumer::~DummyStoreConsumer() { |
| 65 } |
| 66 |
| 67 void DummyStoreConsumer::RequestLoginsAndWait( |
| 68 scoped_refptr<password_manager::PasswordStore> password_store) { |
| 69 autofill::PasswordForm form; |
| 70 password_store->GetLogins( |
| 71 form, password_manager::PasswordStore::DISALLOW_PROMPT, this); |
| 72 message_loop_runner_->Run(); |
| 73 } |
| 74 |
| 75 void DummyStoreConsumer::OnGetPasswordStoreResults( |
| 76 ScopedVector<autofill::PasswordForm> results) { |
| 77 message_loop_runner_->Quit(); |
| 78 } |
| 79 |
60 PromptObserver::PromptObserver() { | 80 PromptObserver::PromptObserver() { |
61 } | 81 } |
| 82 |
62 PromptObserver::~PromptObserver() { | 83 PromptObserver::~PromptObserver() { |
63 } | 84 } |
64 | 85 |
65 bool PromptObserver::IsShowingUpdatePrompt() const { | 86 bool PromptObserver::IsShowingUpdatePrompt() const { |
66 // TODO(dvadym): Make this method pure virtual as soon as update UI is | 87 // TODO(dvadym): Make this method pure virtual as soon as update UI is |
67 // implemented for infobar. http://crbug.com/359315 | 88 // implemented for infobar. http://crbug.com/359315 |
68 return false; | 89 return false; |
69 } | 90 } |
70 | 91 |
71 void PromptObserver::Accept() const { | 92 void PromptObserver::Accept() const { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 " var element = document.getElementById('%s');" | 313 " var element = document.getElementById('%s');" |
293 "window.domAutomationController.send(element && element.value == '%s');", | 314 "window.domAutomationController.send(element && element.value == '%s');", |
294 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(), | 315 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(), |
295 element_id.c_str(), expected_value.c_str()); | 316 element_id.c_str(), expected_value.c_str()); |
296 bool return_value = false; | 317 bool return_value = false; |
297 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 318 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
298 RenderViewHost(), value_check_script, &return_value)); | 319 RenderViewHost(), value_check_script, &return_value)); |
299 EXPECT_TRUE(return_value) << "element_id = " << element_id | 320 EXPECT_TRUE(return_value) << "element_id = " << element_id |
300 << ", expected_value = " << expected_value; | 321 << ", expected_value = " << expected_value; |
301 } | 322 } |
OLD | NEW |