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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_TEST_CRW_FAKE_WEB_CONTROLLER_OBSERVER_H_
6 #define IOS_WEB_TEST_CRW_FAKE_WEB_CONTROLLER_OBSERVER_H_
8 #import <Foundation/Foundation.h>
10 #include "base/memory/scoped_vector.h"
11 #import "ios/web/public/web_state/crw_web_controller_observer.h"
14 class DictionaryValue
;
17 // Fake CRWWebControllerObserver. An OCMock is not used because it cannot handle
18 // C++ types without ugly workarounds, e.g. OCMockComplexTypeHelper/onSelector,
19 // that effectively employ a 'fake' pattern anyway.
20 // WCO uses C++ types (e.g. GURL, DictionaryValue) extensively.
21 @interface CRWFakeWebControllerObserver
: NSObject
<CRWWebControllerObserver
>
23 // Designated initializer. Returns a CRWWebControllerObserver that claims
24 // commands with the prefix |commandPrefix|. |commandPrefix| cannot be nil.
25 - (instancetype
)initWithCommandPrefix
:(NSString
*)commandPrefix
;
27 // YES if the page has loaded.
28 @
property(nonatomic
, readonly
) BOOL pageLoaded
;
30 // The list of commands that have been received and saved.
31 - (ScopedVector
<base::DictionaryValue
>&)commandsReceived
;
35 #endif // IOS_WEB_TEST_CRW_FAKE_WEB_CONTROLLER_OBSERVER_H_