Chromium Code Reviews| Index: content/public/test/mock_navigation_handle.h |
| diff --git a/content/public/test/mock_navigation_handle.h b/content/public/test/mock_navigation_handle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..403aee1e9effe944a1b314578387f427d6621257 |
| --- /dev/null |
| +++ b/content/public/test/mock_navigation_handle.h |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/public/browser/navigation_handle.h" |
| + |
| +#include "testing/gmock/include/gmock/gmock.h" |
| +#include "url/gurl.h" |
| + |
| +namespace content { |
| + |
| +// MockNavigations are instantiated with a url, and all their boolean |
| +// methods return false by default. Make sure to change this mock class |
| +// if you add anything to NavigationHandle. |
| +class MockNavigationHandle : public NavigationHandle { |
| + public: |
| + MockNavigationHandle(GURL url); |
|
Bryan McQuade
2015/09/09 16:26:26
should be explicit
|
| + ~MockNavigationHandle(); |
|
Bryan McQuade
2015/09/09 16:26:26
should be marked 'override' (i think?)
|
| + MOCK_CONST_METHOD0(GetURL, const GURL&()); |
| + MOCK_CONST_METHOD0(GetNetErrorCode, net::Error()); |
| + MOCK_CONST_METHOD0(IsInMainFrame, bool()); |
| + MOCK_CONST_METHOD0(IsSamePage, bool()); |
| + MOCK_CONST_METHOD0(HasCommittedDocument, bool()); |
| + MOCK_CONST_METHOD0(HasCommittedErrorPage, bool()); |
| + |
| + private: |
| + GURL url_; |
| +}; |
| + |
| +} // namespace content |