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 20 matching lines...) Expand all Loading... |
31 : content::WebContentsObserver(web_contents), | 31 : content::WebContentsObserver(web_contents), |
32 quit_on_entry_committed_(false), | 32 quit_on_entry_committed_(false), |
33 message_loop_runner_(new content::MessageLoopRunner) { | 33 message_loop_runner_(new content::MessageLoopRunner) { |
34 } | 34 } |
35 NavigationObserver::~NavigationObserver() { | 35 NavigationObserver::~NavigationObserver() { |
36 } | 36 } |
37 | 37 |
38 void NavigationObserver::DidFinishLoad( | 38 void NavigationObserver::DidFinishLoad( |
39 content::RenderFrameHost* render_frame_host, | 39 content::RenderFrameHost* render_frame_host, |
40 const GURL& validated_url) { | 40 const GURL& validated_url) { |
| 41 render_frame_host_ = render_frame_host; |
41 if (!wait_for_path_.empty()) { | 42 if (!wait_for_path_.empty()) { |
42 if (validated_url.path() == wait_for_path_) | 43 if (validated_url.path() == wait_for_path_) |
43 message_loop_runner_->Quit(); | 44 message_loop_runner_->Quit(); |
44 } else if (!render_frame_host->GetParent()) { | 45 } else if (!render_frame_host->GetParent()) { |
45 message_loop_runner_->Quit(); | 46 message_loop_runner_->Quit(); |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 void NavigationObserver::NavigationEntryCommitted( | 50 void NavigationObserver::NavigationEntryCommitted( |
50 const content::LoadCommittedDetails& load_details) { | 51 const content::LoadCommittedDetails& load_details) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 " var element = document.getElementById('%s');" | 270 " var element = document.getElementById('%s');" |
270 "window.domAutomationController.send(element && element.value == '%s');", | 271 "window.domAutomationController.send(element && element.value == '%s');", |
271 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(), | 272 iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(), |
272 element_id.c_str(), expected_value.c_str()); | 273 element_id.c_str(), expected_value.c_str()); |
273 bool return_value = false; | 274 bool return_value = false; |
274 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 275 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
275 RenderViewHost(), value_check_script, &return_value)); | 276 RenderViewHost(), value_check_script, &return_value)); |
276 EXPECT_TRUE(return_value) << "element_id = " << element_id | 277 EXPECT_TRUE(return_value) << "element_id = " << element_id |
277 << ", expected_value = " << expected_value; | 278 << ", expected_value = " << expected_value; |
278 } | 279 } |
OLD | NEW |