| 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
|
| index c6d67d2ee2ae531e61269791d311751dfb0cc61f..7420220b735391b059e68cd349a6fb011ebd1042 100644
|
| --- a/ios/web/web_state/js/core_js_unittest.mm
|
| +++ b/ios/web/web_state/js/core_js_unittest.mm
|
| @@ -13,15 +13,6 @@
|
|
|
| // Unit tests for ios/web/web_state/js/resources/core.js.
|
|
|
| -namespace {
|
| -
|
| -struct TestScriptAndExpectedValue {
|
| - NSString* test_script;
|
| - id expected_value;
|
| -};
|
| -
|
| -} // namespace
|
| -
|
| namespace web {
|
|
|
| // Test fixture to test core.js.
|
| @@ -65,67 +56,4 @@ TEST_F(CoreJsTest, HasPasswordFieldinFrame) {
|
| << base::SysNSStringToUTF8(data.pageContent);
|
| }
|
|
|
| -TEST_F(CoreJsTest, Stringify) {
|
| - // TODO(jeanfrancoisg): Test whether __gCrWeb.stringify(undefined) correctly
|
| - //returns undefined.
|
| - TestScriptAndExpectedValue testData[] = {
|
| - // Stringify a string that contains various characters that must
|
| - // be escaped.
|
| - {
|
| - @"__gCrWeb.stringify('a\\u000a\\t\\b\\\\\\\"Z')",
|
| - @"\"a\\n\\t\\b\\\\\\\"Z\""
|
| - },
|
| - // Stringify a number.
|
| - {
|
| - @"__gCrWeb.stringify(77.7)",
|
| - @"77.7"
|
| - },
|
| - // Stringify an array.
|
| - {
|
| - @"__gCrWeb.stringify(['a','b'])",
|
| - @"[\"a\",\"b\"]"
|
| - },
|
| - // Stringify an object.
|
| - {
|
| - @"__gCrWeb.stringify({'a':'b','c':'d'})",
|
| - @"{\"a\":\"b\",\"c\":\"d\"}"
|
| - },
|
| - // Stringify a hierarchy of objects and arrays.
|
| - {
|
| - @"__gCrWeb.stringify([{'a':['b','c'],'d':'e'},'f'])",
|
| - @"[{\"a\":[\"b\",\"c\"],\"d\":\"e\"},\"f\"]"
|
| - },
|
| - // Stringify null.
|
| - {
|
| - @"__gCrWeb.stringify(null)",
|
| - @"null"
|
| - },
|
| - // Stringify an object with a toJSON function.
|
| - {
|
| - @"temp = [1,2];"
|
| - "temp.toJSON = function (key) {return undefined};"
|
| - "__gCrWeb.stringify(temp)",
|
| - @"[1,2]"
|
| - },
|
| - // Stringify an object with a toJSON property that is not a function.
|
| - {
|
| - @"temp = [1,2];"
|
| - "temp.toJSON = 42;"
|
| - "__gCrWeb.stringify(temp)",
|
| - @"[1,2]"
|
| - },
|
| - };
|
| -
|
| - for (size_t i = 0; i < arraysize(testData); i++) {
|
| - TestScriptAndExpectedValue& data = testData[i];
|
| - // Load a sample HTML page. As a side-effect, loading HTML via
|
| - // |webController_| will also inject core.js.
|
| - LoadHtml(@"<p>");
|
| - id result = ExecuteJavaScript(data.test_script);
|
| - EXPECT_NSEQ(data.expected_value, result)
|
| - << " in test " << i << ": "
|
| - << base::SysNSStringToUTF8(data.test_script);
|
| - }
|
| -}
|
| -
|
| } // namespace web
|
|
|