| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #import <CoreGraphics/CoreGraphics.h> | 7 #import <CoreGraphics/CoreGraphics.h> |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #import "ios/web/public/test/web_test_with_web_state.h" | 12 #import "ios/web/public/test/web_test_with_web_state.h" |
| 13 #import "ios/web/public/web_state/ui/crw_web_view_proxy.h" | 13 #import "ios/web/public/web_state/ui/crw_web_view_proxy.h" |
| 14 #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h" | 14 #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h" |
| 15 #import "ios/web/public/web_state/web_state.h" | 15 #import "ios/web/public/web_state/web_state.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "testing/gtest_mac.h" | 17 #include "testing/gtest_mac.h" |
| 18 | 18 |
| 19 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 20 #error "This file requires ARC support." |
| 21 #endif |
| 22 |
| 19 // Unit tests for ios/web/web_state/js/resources/context_menu.js. | 23 // Unit tests for ios/web/web_state/js/resources/context_menu.js. |
| 20 | 24 |
| 21 namespace { | 25 namespace { |
| 22 | 26 |
| 23 // Test coordinates and expected result for __gCrWeb.getElementFromPoint call. | 27 // Test coordinates and expected result for __gCrWeb.getElementFromPoint call. |
| 24 struct TestCoordinatesAndExpectedValue { | 28 struct TestCoordinatesAndExpectedValue { |
| 25 TestCoordinatesAndExpectedValue(CGFloat x, CGFloat y, id expected_value) | 29 TestCoordinatesAndExpectedValue(CGFloat x, CGFloat y, id expected_value) |
| 26 : x(x), y(y), expected_value(expected_value) {} | 30 : x(x), y(y), expected_value(expected_value) {} |
| 27 CGFloat x = 0; | 31 CGFloat x = 0; |
| 28 CGFloat y = 0; | 32 CGFloat y = 0; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 expected_result = @{ | 194 expected_result = @{ |
| 191 @"src" : [NSString stringWithFormat:@"%sfoo", BaseUrl().c_str()], | 195 @"src" : [NSString stringWithFormat:@"%sfoo", BaseUrl().c_str()], |
| 192 @"referrerPolicy" : @"default", | 196 @"referrerPolicy" : @"default", |
| 193 }; | 197 }; |
| 194 // Make sure the returned JSON does not have an 'href' key. | 198 // Make sure the returned JSON does not have an 'href' key. |
| 195 EXPECT_NSEQ(expected_result, result); | 199 EXPECT_NSEQ(expected_result, result); |
| 196 } | 200 } |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace web | 203 } // namespace web |
| OLD | NEW |