OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/web_state/web_view_internal_creation_util.h" | 5 #import "ios/web/web_state/web_view_internal_creation_util.h" |
6 | 6 |
7 #import <CoreGraphics/CoreGraphics.h> | 7 #import <CoreGraphics/CoreGraphics.h> |
8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
9 | 9 |
10 #include "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "ios/web/public/test/scoped_testing_web_client.h" | 12 #include "ios/web/public/test/scoped_testing_web_client.h" |
13 #include "ios/web/public/test/test_browser_state.h" | 13 #include "ios/web/public/test/test_browser_state.h" |
14 #import "ios/web/public/test/test_web_client.h" | 14 #import "ios/web/public/test/test_web_client.h" |
15 #include "ios/web/public/test/web_test.h" | 15 #include "ios/web/public/test/web_test.h" |
16 #import "ios/web/public/web_view_creation_util.h" | 16 #import "ios/web/public/web_view_creation_util.h" |
17 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" | 17 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest_mac.h" | 19 #import "testing/gtest_mac.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // An arbitrary sized frame for testing web view creation. | 23 // An arbitrary sized frame for testing web view creation. |
24 const CGRect kTestFrame = CGRectMake(5.0f, 10.0f, 15.0f, 20.0f); | 24 const CGRect kTestFrame = CGRectMake(5.0f, 10.0f, 15.0f, 20.0f); |
25 | 25 |
26 // A WebClient that stubs PreWebViewCreation call for testing purposes. | 26 // A WebClient that stubs PreWebViewCreation call for testing purposes. |
27 class CreationUtilsWebClient : public web::TestWebClient { | 27 class CreationUtilsWebClient : public web::TestWebClient { |
28 public: | 28 public: |
29 MOCK_CONST_METHOD0(PreWebViewCreation, void()); | 29 MOCK_CONST_METHOD0(PreWebViewCreation, void()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 ASSERT_TRUE(web_view2); | 77 ASSERT_TRUE(web_view2); |
78 | 78 |
79 // Make sure that web views share the same non-nil process pool. Otherwise | 79 // Make sure that web views share the same non-nil process pool. Otherwise |
80 // cookie will not be immediately shared between different web views. | 80 // cookie will not be immediately shared between different web views. |
81 EXPECT_TRUE([[web_view configuration] processPool]); | 81 EXPECT_TRUE([[web_view configuration] processPool]); |
82 EXPECT_EQ([[web_view configuration] processPool], | 82 EXPECT_EQ([[web_view configuration] processPool], |
83 [[web_view2 configuration] processPool]); | 83 [[web_view2 configuration] processPool]); |
84 } | 84 } |
85 | 85 |
86 } // namespace web | 86 } // namespace web |
OLD | NEW |