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

Unified Diff: ios/web/web_state/js/core_js_unittest.mm

Issue 2814773002: Move password-related methods from core.js to password_controller.js. (Closed)
Patch Set: Address reviewer comment (fix verb tense in test comment) Created 3 years, 8 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 | « ios/web/BUILD.gn ('k') | ios/web/web_state/js/resources/core.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/js/core_js_unittest.mm
diff --git a/ios/web/web_state/js/core_js_unittest.mm b/ios/web/web_state/js/core_js_unittest.mm
deleted file mode 100644
index 7420220b735391b059e68cd349a6fb011ebd1042..0000000000000000000000000000000000000000
--- a/ios/web/web_state/js/core_js_unittest.mm
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <vector>
-
-#include "base/macros.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/sys_string_conversions.h"
-#import "ios/web/public/test/web_test_with_web_state.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/gtest_mac.h"
-
-// Unit tests for ios/web/web_state/js/resources/core.js.
-
-namespace web {
-
-// Test fixture to test core.js.
-typedef web::WebTestWithWebState CoreJsTest;
-
-struct TestDataForPasswordFormDetection {
- NSString* pageContent;
- NSNumber* containsPassword;
-};
-
-TEST_F(CoreJsTest, HasPasswordField) {
- TestDataForPasswordFormDetection testData[] = {
- // Form without a password field.
- {@"<form><input type='text' name='password'></form>", @NO},
- // Form with a password field.
- {@"<form><input type='password' name='password'></form>", @YES}};
- for (size_t i = 0; i < arraysize(testData); i++) {
- TestDataForPasswordFormDetection& data = testData[i];
- LoadHtml(data.pageContent);
- id result = ExecuteJavaScript(@"__gCrWeb.hasPasswordField()");
- EXPECT_NSEQ(data.containsPassword, result)
- << " in test " << i << ": "
- << base::SysNSStringToUTF8(data.pageContent);
- }
-}
-
-TEST_F(CoreJsTest, HasPasswordFieldinFrame) {
- TestDataForPasswordFormDetection data = {
- // Form with a password field in a nested iframe.
- @"<iframe name='pf'></iframe>"
- "<script>"
- " var doc = frames['pf'].document.open();"
- " doc.write('<form><input type=\\'password\\'></form>');"
- " doc.close();"
- "</script>",
- @YES
- };
- LoadHtml(data.pageContent);
- id result = ExecuteJavaScript(@"__gCrWeb.hasPasswordField()");
- EXPECT_NSEQ(data.containsPassword, result)
- << base::SysNSStringToUTF8(data.pageContent);
-}
-
-} // namespace web
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/web_state/js/resources/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698