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

Unified Diff: chrome/browser/password_manager/password_manager_test_base.cc

Issue 2776513002: Enable PasswordManagerBrowserTestBase.SameOriginIframeAutoFillTest to get more data (Closed)
Patch Set: Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_test_base.cc
diff --git a/chrome/browser/password_manager/password_manager_test_base.cc b/chrome/browser/password_manager/password_manager_test_base.cc
index e51a992620ae11a5e81d28de9a9eb41288a04a75..d691c3afcef9c88729a3aeceab661b7a305e3ab0 100644
--- a/chrome/browser/password_manager/password_manager_test_base.cc
+++ b/chrome/browser/password_manager/password_manager_test_base.cc
@@ -400,20 +400,20 @@ void PasswordManagerBrowserTestBase::CheckElementValue(
const std::string& iframe_id,
const std::string& element_id,
const std::string& expected_value) {
- const std::string value_check_script = base::StringPrintf(
+ const std::string value_get_script = base::StringPrintf(
"if (%s)"
" var element = document.getElementById("
" '%s').contentDocument.getElementById('%s');"
"else "
" var element = document.getElementById('%s');"
- "window.domAutomationController.send(element && element.value == '%s');",
+ "var value = element ? element.value : 'element not found';"
+ "window.domAutomationController.send(value);",
iframe_id.c_str(), iframe_id.c_str(), element_id.c_str(),
- element_id.c_str(), expected_value.c_str());
- bool return_value = false;
- ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
- RenderViewHost(), value_check_script, &return_value));
- EXPECT_TRUE(return_value) << "element_id = " << element_id
- << ", expected_value = " << expected_value;
+ element_id.c_str());
+ std::string return_value;
+ ASSERT_TRUE(content::ExecuteScriptAndExtractString(
+ RenderViewHost(), value_get_script, &return_value));
+ EXPECT_EQ(expected_value, return_value) << "element_id = " << element_id;
}
void PasswordManagerBrowserTestBase::AddHSTSHost(const std::string& host) {
« no previous file with comments | « chrome/browser/password_manager/password_manager_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698