| Index: ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| index 1526b068e11234dfd68495d839e620524b93ed6d..b4e50ea1ef4dc1e105b5f973b006db92c77c7d6d 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| @@ -10,9 +10,7 @@
|
|
|
| #include "base/ios/ios_util.h"
|
| #include "base/mac/scoped_nsobject.h"
|
| -#include "base/strings/sys_string_conversions.h"
|
| #import "base/test/ios/wait_util.h"
|
| -#include "base/values.h"
|
| #import "ios/testing/ocmock_complex_type_helper.h"
|
| #include "ios/web/navigation/crw_session_controller.h"
|
| #include "ios/web/navigation/crw_session_entry.h"
|
| @@ -204,29 +202,15 @@ typedef BOOL (^openExternalURLBlockType)(const GURL&);
|
| @interface CountingObserver : NSObject<CRWWebControllerObserver>
|
|
|
| @property(nonatomic, readonly) int pageLoadedCount;
|
| -@property(nonatomic, readonly) int messageCount;
|
| @end
|
|
|
| @implementation CountingObserver
|
| @synthesize pageLoadedCount = _pageLoadedCount;
|
| -@synthesize messageCount = _messageCount;
|
|
|
| - (void)pageLoaded:(CRWWebController*)webController {
|
| ++_pageLoadedCount;
|
| }
|
|
|
| -- (BOOL)handleCommand:(const base::DictionaryValue&)command
|
| - webController:(CRWWebController*)webController
|
| - userIsInteracting:(BOOL)userIsInteracting
|
| - originURL:(const GURL&)originURL {
|
| - ++_messageCount;
|
| - return YES;
|
| -}
|
| -
|
| -- (NSString*)commandPrefix {
|
| - return @"wctest";
|
| -}
|
| -
|
| @end
|
|
|
| namespace {
|
| @@ -907,17 +891,6 @@ TEST_F(CRWWebControllerObserversTest, Observers) {
|
| [web_controller() webStateImpl]->OnPageLoaded(GURL("http://test"), true);
|
| EXPECT_EQ(1, [observer pageLoadedCount]);
|
|
|
| - EXPECT_EQ(0, [observer messageCount]);
|
| - // Non-matching prefix.
|
| - EXPECT_FALSE([web_controller() webStateImpl]->OnScriptCommandReceived(
|
| - "a", base::DictionaryValue(), GURL("http://test"), true));
|
| - EXPECT_EQ(0, [observer messageCount]);
|
| - // Matching prefix.
|
| - EXPECT_TRUE([web_controller() webStateImpl]->OnScriptCommandReceived(
|
| - base::SysNSStringToUTF8([observer commandPrefix]) + ".foo",
|
| - base::DictionaryValue(), GURL("http://test"), true));
|
| - EXPECT_EQ(1, [observer messageCount]);
|
| -
|
| [web_controller() removeObserver:observer];
|
| EXPECT_EQ(0u, [web_controller() observerCount]);
|
| };
|
|
|