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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 | 6 |
7 #import "ios/chrome/browser/passwords/js_password_manager.h" | 7 #import "ios/chrome/browser/passwords/js_password_manager.h" |
8 #import "ios/web/public/test/web_js_test.h" | 8 #import "ios/web/public/test/web_js_test.h" |
9 #import "ios/web/public/test/web_test_with_web_state.h" | 9 #import "ios/web/public/test/web_test_with_web_state.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "testing/gtest_mac.h" | 11 #include "testing/gtest_mac.h" |
12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
13 // Unit tests for ios/chrome/browser/web/resources/password_controller.js | 17 // Unit tests for ios/chrome/browser/web/resources/password_controller.js |
14 namespace { | 18 namespace { |
15 | 19 |
16 // Text fixture to test password controller. | 20 // Text fixture to test password controller. |
17 class PasswordControllerJsTest | 21 class PasswordControllerJsTest |
18 : public web::WebJsTest<web::WebTestWithWebState> { | 22 : public web::WebJsTest<web::WebTestWithWebState> { |
19 public: | 23 public: |
20 PasswordControllerJsTest() | 24 PasswordControllerJsTest() |
21 : web::WebJsTest<web::WebTestWithWebState>(@[ @"password_controller" ]) {} | 25 : web::WebJsTest<web::WebTestWithWebState>(@[ @"password_controller" ]) {} |
22 }; | 26 }; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 "\"usernameValue\":\"\"," | 295 "\"usernameValue\":\"\"," |
292 "\"passwords\":[{\"element\":\"password\",\"value\":\"\"}]}", | 296 "\"passwords\":[{\"element\":\"password\",\"value\":\"\"}]}", |
293 base_url.c_str()]; | 297 base_url.c_str()]; |
294 EXPECT_NSEQ( | 298 EXPECT_NSEQ( |
295 result, | 299 result, |
296 ExecuteJavaScriptWithFormat( | 300 ExecuteJavaScriptWithFormat( |
297 @"__gCrWeb.stringify(__gCrWeb.getPasswordFormData(%@))", parameter)); | 301 @"__gCrWeb.stringify(__gCrWeb.getPasswordFormData(%@))", parameter)); |
298 }; | 302 }; |
299 | 303 |
300 } // namespace | 304 } // namespace |
OLD | NEW |