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

Side by Side Diff: chrome/browser/tab_contents/test_tab_contents.h

Issue 3585002: Revert 60963 - Merge 58701 - Relanding this:... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/517/src/
Patch Set: Created 10 years, 2 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/tab_contents/tab_contents.h" 9 #include "chrome/browser/tab_contents/tab_contents.h"
10 #include "chrome/common/notification_registrar.h" 10 #include "chrome/common/notification_registrar.h"
11 #include "webkit/glue/webpreferences.h" 11 #include "webkit/glue/webpreferences.h"
12 12
13 class Profile; 13 class Profile;
14 class TestRenderViewHost; 14 class TestRenderViewHost;
15 15
16 // Subclass TabContents to ensure it creates TestRenderViewHosts and does 16 // Subclass TabContents to ensure it creates TestRenderViewHosts and does
17 // not do anything involving views. 17 // not do anything involving views.
18 class TestTabContents : public TabContents { 18 class TestTabContents : public TabContents {
19 public: 19 public:
20 // The render view host factory will be passed on to the 20 // The render view host factory will be passed on to the
21 TestTabContents(Profile* profile, SiteInstance* instance); 21 TestTabContents(Profile* profile, SiteInstance* instance);
22 22
23 TestRenderViewHost* pending_rvh() const; 23 TestRenderViewHost* pending_rvh();
24 24
25 // State accessor. 25 // State accessor.
26 bool cross_navigation_pending() { 26 bool cross_navigation_pending() {
27 return render_manager_.cross_navigation_pending_; 27 return render_manager_.cross_navigation_pending_;
28 } 28 }
29 29
30 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both 30 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both
31 // alternatives without using command-line switches. 31 // alternatives without using command-line switches.
32 bool ShouldTransitionCrossSite() { return transition_cross_site; } 32 bool ShouldTransitionCrossSite() { return transition_cross_site; }
33 33
(...skipping 21 matching lines...) Expand all
55 55
56 // Returns a clone of this TestTabContents. The returned object is also a 56 // Returns a clone of this TestTabContents. The returned object is also a
57 // TestTabContents. The caller owns the returned object. 57 // TestTabContents. The caller owns the returned object.
58 virtual TabContents* Clone(); 58 virtual TabContents* Clone();
59 59
60 // Creates a pending navigation to the given URL with the default parameters 60 // Creates a pending navigation to the given URL with the default parameters
61 // and then commits the load with a page ID one larger than any seen. This 61 // and then commits the load with a page ID one larger than any seen. This
62 // emulates what happens on a new navigation. 62 // emulates what happens on a new navigation.
63 void NavigateAndCommit(const GURL& url); 63 void NavigateAndCommit(const GURL& url);
64 64
65 // Simulates the appropriate RenderView (pending if any, current otherwise)
66 // sending a navigate notification for the NavigationController pending entry.
67 void CommitPendingNavigation();
68
69 // Simulates the current RVH notifying that it has unloaded so that the
70 // pending RVH navigation can proceed.
71 // Does nothing if no cross-navigation is pending.
72 void ProceedWithCrossSiteNavigation();
73
74 // Set by individual tests. 65 // Set by individual tests.
75 bool transition_cross_site; 66 bool transition_cross_site;
76 67
77 NotificationRegistrar registrar_; 68 NotificationRegistrar registrar_;
78 }; 69 };
79 70
80 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ 71 #endif // CHROME_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | chrome/browser/tab_contents/test_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698