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

Side by Side Diff: ios/chrome/browser/ui/dialogs/javascript_dialog_blocking_util_unittest.mm

Issue 2614443004: [ios] Moved all web mocks to ios/web/public/test/fakes. (Closed)
Patch Set: Moved test_redirect_observer back Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chrome/browser/ui/dialogs/javascript_dialog_blocking_util.h" 5 #import "ios/chrome/browser/ui/dialogs/javascript_dialog_blocking_util.h"
6 6
7 #include "ios/web/public/load_committed_details.h" 7 #include "ios/web/public/load_committed_details.h"
8 #include "ios/web/public/test/test_web_state.h" 8 #import "ios/web/public/test/fakes/test_web_state.h"
9 #include "ios/web/public/web_state/web_state_observer.h" 9 #include "ios/web/public/web_state/web_state_observer.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc) 12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support." 13 #error "This file requires ARC support."
14 #endif 14 #endif
15 15
16 namespace { 16 namespace {
17 // TestWebState subclass that allows simulating page loads. 17 // TestWebState subclass that allows simulating page loads.
18 class JavaScriptBlockingTestWebState : public web::TestWebState { 18 class JavaScriptBlockingTestWebState : public web::TestWebState {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 // Tests that ShouldBlockDialogsForPresenter() returns false after a page load. 65 // Tests that ShouldBlockDialogsForPresenter() returns false after a page load.
66 TEST(JavaScriptDialogBlockingTest, StopBlocking) { 66 TEST(JavaScriptDialogBlockingTest, StopBlocking) {
67 JavaScriptBlockingTestWebState webState; 67 JavaScriptBlockingTestWebState webState;
68 EXPECT_FALSE(ShouldBlockJavaScriptDialogs(&webState)); 68 EXPECT_FALSE(ShouldBlockJavaScriptDialogs(&webState));
69 DialogBlockingOptionSelected(&webState); 69 DialogBlockingOptionSelected(&webState);
70 EXPECT_TRUE(ShouldBlockJavaScriptDialogs(&webState)); 70 EXPECT_TRUE(ShouldBlockJavaScriptDialogs(&webState));
71 webState.SimulatePageLoaded(); 71 webState.SimulatePageLoaded();
72 EXPECT_FALSE(ShouldBlockJavaScriptDialogs(&webState)); 72 EXPECT_FALSE(ShouldBlockJavaScriptDialogs(&webState));
73 } 73 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/dialogs/dialog_presenter_unittest.mm ('k') | ios/chrome/browser/ui/fullscreen_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698