OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "ios/chrome/browser/web/chrome_web_client.h" | 5 #include "ios/chrome/browser/web/chrome_web_client.h" |
6 | 6 |
7 #include <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
15 #import "ios/web/public/test/js_test_util.h" | 15 #import "ios/web/public/test/js_test_util.h" |
16 #include "ios/web/public/test/scoped_testing_web_client.h" | 16 #include "ios/web/public/test/scoped_testing_web_client.h" |
17 #include "ios/web/public/test/test_browser_state.h" | 17 #include "ios/web/public/test/test_browser_state.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); | 78 web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); |
79 NSString* script = web_client.Get()->GetEarlyPageScript(); | 79 NSString* script = web_client.Get()->GetEarlyPageScript(); |
80 web::ExecuteJavaScript(web_view, script); | 80 web::ExecuteJavaScript(web_view, script); |
81 EXPECT_NSEQ(@"object", | 81 EXPECT_NSEQ(@"object", |
82 web::ExecuteJavaScript(web_view, @"typeof __gCrWeb.print")); | 82 web::ExecuteJavaScript(web_view, @"typeof __gCrWeb.print")); |
83 EXPECT_NSEQ(@"undefined", web::ExecuteJavaScript( | 83 EXPECT_NSEQ(@"undefined", web::ExecuteJavaScript( |
84 web_view, @"typeof __gCrWeb.windowOpenFix")); | 84 web_view, @"typeof __gCrWeb.windowOpenFix")); |
85 } | 85 } |
86 | 86 |
87 } // namespace | 87 } // namespace |
OLD | NEW |