OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <string> | 5 #include <string> |
6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_commands.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
7 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
8 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
10 #include "content/public/common/url_constants.h" | 13 #include "content/public/common/url_constants.h" |
| 14 #include "content/public/test/browser_test_utils.h" |
| 15 #include "ui/base/window_open_disposition.h" |
11 #include "url/gurl.h" | 16 #include "url/gurl.h" |
12 | 17 |
13 typedef InProcessBrowserTest MdSettingsBrowserTest; | 18 typedef InProcessBrowserTest MdSettingsBrowserTest; |
14 | 19 |
| 20 using ui_test_utils::NavigateToURL; |
| 21 using content::WaitForLoadStop; |
| 22 |
15 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, ViewSourceDoesntCrash) { | 23 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, ViewSourceDoesntCrash) { |
16 ui_test_utils::NavigateToURL(browser(), | 24 NavigateToURL(browser(), |
17 GURL(content::kViewSourceScheme + std::string(":") + | 25 GURL(content::kViewSourceScheme + std::string(":") + |
18 chrome::kChromeUIMdSettingsURL)); | 26 chrome::kChromeUIMdSettingsURL)); |
19 } | 27 } |
| 28 |
| 29 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, BackForwardDoesntCrash) { |
| 30 NavigateToURL(browser(), GURL(chrome::kChromeUIMdSettingsURL)); |
| 31 |
| 32 NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 33 |
| 34 chrome::GoBack(browser(), CURRENT_TAB); |
| 35 WaitForLoadStop(browser()->tab_strip_model()->GetActiveWebContents()); |
| 36 } |
OLD | NEW |