Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ios/web/browser_state_web_view_partition_inttest.mm

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/web/app/web_main_runner.mm ('k') | ios/web/interstitials/html_web_interstitial_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string>
6 #import <WebKit/WebKit.h> 5 #import <WebKit/WebKit.h>
7 6
7 #include <memory>
8 #include <string>
9
8 #import "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/test/ios/wait_util.h" 11 #include "base/test/ios/wait_util.h"
11 #include "ios/web/public/browser_state.h" 12 #include "ios/web/public/browser_state.h"
12 #import "ios/web/public/test/http_server.h" 13 #import "ios/web/public/test/http_server.h"
13 #include "ios/web/public/test/response_providers/string_response_provider.h" 14 #include "ios/web/public/test/response_providers/string_response_provider.h"
14 #import "ios/web/public/web_view_creation_util.h" 15 #import "ios/web/public/web_view_creation_util.h"
15 #import "ios/web/test/web_int_test.h" 16 #import "ios/web/test/web_int_test.h"
16 #import "ios/web/web_state/ui/web_view_js_utils.h" 17 #import "ios/web/web_state/ui/web_view_js_utils.h"
17 #import "net/base/mac/url_conversions.h" 18 #import "net/base/mac/url_conversions.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 #include "testing/gtest_mac.h" 20 #include "testing/gtest_mac.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 }); 127 });
127 128
128 web_view.navigationDelegate = old_navigation_delegate; 129 web_view.navigationDelegate = old_navigation_delegate;
129 } 130 }
130 131
131 // Returns the BrowserState that is used for testing. 132 // Returns the BrowserState that is used for testing.
132 web::BrowserState* GetOtrBrowserState() { return &otr_browser_state_; } 133 web::BrowserState* GetOtrBrowserState() { return &otr_browser_state_; }
133 134
134 private: 135 private:
135 // The ResponseProvider used to load a simple web page. 136 // The ResponseProvider used to load a simple web page.
136 scoped_ptr<web::ResponseProvider> provider_; 137 std::unique_ptr<web::ResponseProvider> provider_;
137 // The OTR browser state used in tests. 138 // The OTR browser state used in tests.
138 web::TestBrowserState otr_browser_state_; 139 web::TestBrowserState otr_browser_state_;
139 }; 140 };
140 141
141 // Tests that cookies are partitioned between web views created with a 142 // Tests that cookies are partitioned between web views created with a
142 // non-OTR BrowserState and an OTR BrowserState. 143 // non-OTR BrowserState and an OTR BrowserState.
143 TEST_F(BrowserStateWebViewPartitionTest, Cookies) { 144 TEST_F(BrowserStateWebViewPartitionTest, Cookies) {
144 base::scoped_nsobject<WKWebView> web_view_1( 145 base::scoped_nsobject<WKWebView> web_view_1(
145 web::CreateWKWebView(CGRectZero, GetBrowserState())); 146 web::CreateWKWebView(CGRectZero, GetBrowserState()));
146 LoadTestWebPage(web_view_1); 147 LoadTestWebPage(web_view_1);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 SetLocalStorageItem(@"someKey2", @"someValue2", web_view_2); 182 SetLocalStorageItem(@"someKey2", @"someValue2", web_view_2);
182 // Due to platform limitation, it's not possible to actually set localStorage 183 // Due to platform limitation, it's not possible to actually set localStorage
183 // item on an OTR BrowserState. Therefore, it's not possible to verify that a 184 // item on an OTR BrowserState. Therefore, it's not possible to verify that a
184 // localStorage item has been correctly set. 185 // localStorage item has been correctly set.
185 // Look at 186 // Look at
186 // http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-s afari-quota-exceeded-err-dom-exception-22-an 187 // http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-s afari-quota-exceeded-err-dom-exception-22-an
187 // for more details. 188 // for more details.
188 // Test that LocalStorage has not leaked over to |web_view_1|. 189 // Test that LocalStorage has not leaked over to |web_view_1|.
189 EXPECT_NSEQ(@"", GetLocalStorageItem(@"someKey2", web_view_1)); 190 EXPECT_NSEQ(@"", GetLocalStorageItem(@"someKey2", web_view_1));
190 } 191 }
OLDNEW
« no previous file with comments | « ios/web/app/web_main_runner.mm ('k') | ios/web/interstitials/html_web_interstitial_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698