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..e2151ed061ebded23e0e72f2866401620f59029b |
| --- /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 { |
|
clamy
2015/09/10 12:16:24
Sorry I missed this on my last pass on the code. I
|
| + public: |
| + explicit MockNavigationHandle(GURL url); |
| + ~MockNavigationHandle() override; |
| + 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 |