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

Side by Side Diff: content/test/browser_side_navigation_test_utils.h

Issue 730553002: PlzNavigate: Refactor unit test helper functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comments Created 6 years, 1 month 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
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/browser_side_navigation_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_TEST_BROWSER_SIDE_NAVIGATION_TEST_UTILS_H_
6 #define CONTENT_TEST_BROWSER_SIDE_NAVIGATION_TEST_UTILS_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace content {
12
13 class StreamHandle;
14 class StreamRegistry;
15 class TestNavigationURLLoaderFactory;
16
17 // PlzNavigate
18 // A UI thread singleton helper class for browser side navigations. When browser
19 // side navigations are enabled, initialize this class before doing any
20 // operation that may start a navigation request on the UI thread. Use TearDown
21 // at the end of the test.
22 class BrowserSideNavigationTestUtils {
23 public:
24 // Initializes the BrowserSideNavigationsTestUtils. Following this call, all
25 // NavigationURLLoader objects created will be TestNavigationURLLoaders
26 // instead of NavigationURLloaderImpls. This should be called before any call
27 // in the UI thread unit tests that will start a navigation (eg.
28 // TestWebContents::NavigateAndCommit).
29 static void SetUp();
30
31 // Destroys the BrowserSideNavigationTestUtils singleton.
32 static void TearDown();
33
34 // Returns an empty stream. Used when faking a navigation commit notification
35 // from the IO thread with a TestNavigationURLLoader.
36 static scoped_ptr<StreamHandle> MakeEmptyStream();
nasko 2014/11/17 22:40:02 A class full of static methods is equivalent to a
clamy 2014/11/18 12:33:22 When writing the web_url_request_util, jam@ specif
37
38 static void EnableBrowserSideNavigation();
39
40 ~BrowserSideNavigationTestUtils();
41
42 private:
43 BrowserSideNavigationTestUtils();
44
45 scoped_ptr<StreamRegistry> stream_registry_;
46 scoped_ptr<TestNavigationURLLoaderFactory> loader_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(BrowserSideNavigationTestUtils);
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_TEST_BROWSER_SIDE_NAVIGATION_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/browser_side_navigation_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698