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" | |
10 #include "chrome/common/url_constants.h" | 7 #include "chrome/common/url_constants.h" |
11 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
13 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
14 #include "content/public/test/browser_test_utils.h" | |
15 #include "ui/base/window_open_disposition.h" | |
16 #include "url/gurl.h" | 11 #include "url/gurl.h" |
17 | 12 |
18 typedef InProcessBrowserTest MdSettingsBrowserTest; | 13 typedef InProcessBrowserTest MdSettingsBrowserTest; |
19 | 14 |
20 using ui_test_utils::NavigateToURL; | |
21 using content::WaitForLoadStop; | |
22 | |
23 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, ViewSourceDoesntCrash) { | 15 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, ViewSourceDoesntCrash) { |
24 NavigateToURL(browser(), | 16 ui_test_utils::NavigateToURL(browser(), |
25 GURL(content::kViewSourceScheme + std::string(":") + | 17 GURL(content::kViewSourceScheme + std::string(":") + |
26 chrome::kChromeUIMdSettingsURL)); | 18 chrome::kChromeUIMdSettingsURL)); |
27 } | 19 } |
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 |