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 // May not complete on memory bots. TODO(dbeam): investigate and fix. |
| 30 // See https://crbug.com/558434 and https://crbug.com/620370. |
| 31 #if defined(MEMORY_SANITIZER) |
| 32 #define MAYBE_BackForwardDoesntCrash DISABLED_BackForwardDoesntCrash |
| 33 #else |
| 34 #define MAYBE_BackForwardDoesntCrash BackForwardDoesntCrash |
| 35 #endif |
| 36 |
| 37 IN_PROC_BROWSER_TEST_F(MdSettingsBrowserTest, MAYBE_BackForwardDoesntCrash) { |
| 38 NavigateToURL(browser(), GURL(chrome::kChromeUIMdSettingsURL)); |
| 39 |
| 40 NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
| 41 |
| 42 chrome::GoBack(browser(), CURRENT_TAB); |
| 43 WaitForLoadStop(browser()->tab_strip_model()->GetActiveWebContents()); |
| 44 } |
OLD | NEW |