| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
| 12 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace base { |
| 17 class CommandLine; |
| 18 } |
| 19 |
| 16 namespace chrome { | 20 namespace chrome { |
| 17 struct NavigateParams; | 21 struct NavigateParams; |
| 18 } | 22 } |
| 19 | 23 |
| 20 namespace content { | 24 namespace content { |
| 21 class WebContents; | 25 class WebContents; |
| 22 } | 26 } |
| 23 | 27 |
| 24 // Browsertest class for testing the browser navigation. It is also a base class | 28 // Browsertest class for testing the browser navigation. It is also a base class |
| 25 // for the |BrowserGuestModeNavigation| which tests navigation while in guest | 29 // for the |BrowserGuestModeNavigation| which tests navigation while in guest |
| 26 // mode. | 30 // mode. |
| 27 class BrowserNavigatorTest : public InProcessBrowserTest, | 31 class BrowserNavigatorTest : public InProcessBrowserTest, |
| 28 public content::NotificationObserver { | 32 public content::NotificationObserver { |
| 29 protected: | 33 protected: |
| 30 chrome::NavigateParams MakeNavigateParams() const; | 34 chrome::NavigateParams MakeNavigateParams() const; |
| 31 chrome::NavigateParams MakeNavigateParams(Browser* browser) const; | 35 chrome::NavigateParams MakeNavigateParams(Browser* browser) const; |
| 32 | 36 |
| 33 Browser* CreateEmptyBrowserForType(Browser::Type type, Profile* profile); | 37 Browser* CreateEmptyBrowserForType(Browser::Type type, Profile* profile); |
| 34 Browser* CreateEmptyBrowserForApp(Profile* profile); | 38 Browser* CreateEmptyBrowserForApp(Profile* profile); |
| 35 | 39 |
| 36 content::WebContents* CreateWebContents(); | 40 content::WebContents* CreateWebContents(); |
| 37 | 41 |
| 38 void RunSuppressTest(WindowOpenDisposition disposition); | 42 void RunSuppressTest(WindowOpenDisposition disposition); |
| 39 void RunUseNonIncognitoWindowTest(const GURL& url); | 43 void RunUseNonIncognitoWindowTest(const GURL& url); |
| 40 void RunDoNothingIfIncognitoIsForcedTest(const GURL& url); | 44 void RunDoNothingIfIncognitoIsForcedTest(const GURL& url); |
| 41 | 45 |
| 46 // InProcessBrowserTest: |
| 47 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
| 48 |
| 42 // content::NotificationObserver: | 49 // content::NotificationObserver: |
| 43 virtual void Observe(int type, | 50 virtual void Observe(int type, |
| 44 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
| 45 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
| 46 | 53 |
| 47 bool OpenPOSTURLInNewForegroundTabAndGetTitle(const GURL& url, | 54 bool OpenPOSTURLInNewForegroundTabAndGetTitle(const GURL& url, |
| 48 const std::string& post_data, | 55 const std::string& post_data, |
| 49 bool is_browser_initiated, | 56 bool is_browser_initiated, |
| 50 base::string16* title); | 57 base::string16* title); |
| 51 | 58 |
| 52 size_t created_tab_contents_count_; | 59 size_t created_tab_contents_count_; |
| 53 }; | 60 }; |
| 54 | 61 |
| 55 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ | 62 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_BROWSERTEST_H_ |
| OLD | NEW |