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 #import <WebKit/WebKit.h> | 5 #import <WebKit/WebKit.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
11 #import "base/mac/scoped_nsobject.h" | 11 #import "base/mac/scoped_nsobject.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/test/ios/wait_util.h" | 13 #import "base/test/ios/wait_util.h" |
14 #include "ios/web/public/browser_state.h" | 14 #include "ios/web/public/browser_state.h" |
15 #import "ios/web/public/test/http_server.h" | 15 #import "ios/web/public/test/http_server.h" |
16 #import "ios/web/public/test/js_test_util.h" | 16 #import "ios/web/public/test/js_test_util.h" |
17 #include "ios/web/public/test/response_providers/string_response_provider.h" | 17 #import "ios/web/public/test/response_providers/string_response_provider.h" |
18 #import "ios/web/public/web_view_creation_util.h" | 18 #import "ios/web/public/web_view_creation_util.h" |
19 #import "ios/web/test/web_int_test.h" | 19 #import "ios/web/test/web_int_test.h" |
20 #import "net/base/mac/url_conversions.h" | 20 #import "net/base/mac/url_conversions.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "testing/gtest_mac.h" | 22 #import "testing/gtest_mac.h" |
23 | 23 |
24 // A WKNavigationDelegate that is used to check if a WKWebView has finished | 24 // A WKNavigationDelegate that is used to check if a WKWebView has finished |
25 // a navigation. Used for testing purposes. | 25 // a navigation. Used for testing purposes. |
26 @interface TestNavigationDelegate : NSObject <WKNavigationDelegate> | 26 @interface TestNavigationDelegate : NSObject <WKNavigationDelegate> |
27 // YES if a navigation has finished. | 27 // YES if a navigation has finished. |
28 @property (nonatomic, assign) BOOL didFinishNavigation; | 28 @property (nonatomic, assign) BOOL didFinishNavigation; |
29 @end | 29 @end |
30 | 30 |
31 @implementation TestNavigationDelegate | 31 @implementation TestNavigationDelegate |
32 | 32 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 SetLocalStorageItem(@"someKey2", @"someValue2", web_view_2); | 170 SetLocalStorageItem(@"someKey2", @"someValue2", web_view_2); |
171 // Due to platform limitation, it's not possible to actually set localStorage | 171 // Due to platform limitation, it's not possible to actually set localStorage |
172 // item on an OTR BrowserState. Therefore, it's not possible to verify that a | 172 // item on an OTR BrowserState. Therefore, it's not possible to verify that a |
173 // localStorage item has been correctly set. | 173 // localStorage item has been correctly set. |
174 // Look at | 174 // Look at |
175 // http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-s
afari-quota-exceeded-err-dom-exception-22-an | 175 // http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-s
afari-quota-exceeded-err-dom-exception-22-an |
176 // for more details. | 176 // for more details. |
177 // Test that LocalStorage has not leaked over to |web_view_1|. | 177 // Test that LocalStorage has not leaked over to |web_view_1|. |
178 EXPECT_NSEQ([NSNull null], GetLocalStorageItem(@"someKey2", web_view_1)); | 178 EXPECT_NSEQ([NSNull null], GetLocalStorageItem(@"someKey2", web_view_1)); |
179 } | 179 } |
OLD | NEW |