| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #import <Foundation/Foundation.h> | 6 #import <Foundation/Foundation.h> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "ios/web/public/test/web_test_with_web_state.h" | 10 #import "ios/web/public/test/web_test_with_web_state.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #import "testing/gtest_mac.h" | 12 #import "testing/gtest_mac.h" |
| 13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
| 14 namespace { | 18 namespace { |
| 15 | 19 |
| 16 // Struct for isTextField() test data. | 20 // Struct for isTextField() test data. |
| 17 struct TextFieldTestElement { | 21 struct TextFieldTestElement { |
| 18 // The element name. | 22 // The element name. |
| 19 const char* element_name; | 23 const char* element_name; |
| 20 // The index of this element in those that have the same name. | 24 // The index of this element in those that have the same name. |
| 21 const int element_index; | 25 const int element_index; |
| 22 // True if this is expected to be a text field. | 26 // True if this is expected to be a text field. |
| 23 const bool expected_is_text_field; | 27 const bool expected_is_text_field; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // |webController_| will also inject web_bundle.js. | 136 // |webController_| will also inject web_bundle.js. |
| 133 LoadHtml(@"<p>"); | 137 LoadHtml(@"<p>"); |
| 134 id result = ExecuteJavaScript(data.test_script); | 138 id result = ExecuteJavaScript(data.test_script); |
| 135 EXPECT_NSEQ(data.expected_value, result) | 139 EXPECT_NSEQ(data.expected_value, result) |
| 136 << " in test " << i << ": " | 140 << " in test " << i << ": " |
| 137 << base::SysNSStringToUTF8(data.test_script); | 141 << base::SysNSStringToUTF8(data.test_script); |
| 138 } | 142 } |
| 139 } | 143 } |
| 140 | 144 |
| 141 } // namespace web | 145 } // namespace web |
| OLD | NEW |