OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "chrome/common/url_constants.h" | 6 #include "chrome/common/url_constants.h" |
7 #include "chrome/test/base/in_process_browser_test.h" | 7 #include "chrome/test/base/in_process_browser_test.h" |
8 #include "chrome/test/base/ui_test_utils.h" | 8 #include "chrome/test/base/ui_test_utils.h" |
9 #include "content/public/browser/navigation_details.h" | 9 #include "content/public/browser/navigation_details.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Makes sure navigating to the new tab page results in a http status code | 51 // Makes sure navigating to the new tab page results in a http status code |
52 // of 200. | 52 // of 200. |
53 IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, 200) { | 53 IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, 200) { |
54 NavigationNotificationObserver observer; | 54 NavigationNotificationObserver observer; |
55 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); | 55 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
56 EXPECT_TRUE(observer.got_navigation()); | 56 EXPECT_TRUE(observer.got_navigation()); |
57 EXPECT_EQ(200, observer.http_status_code()); | 57 EXPECT_EQ(200, observer.http_status_code()); |
58 } | 58 } |
59 | 59 |
| 60 // Makes sure browser does not crash when navigating to an unknown resource. |
| 61 IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, UnknownResource) { |
| 62 // Known resource |
| 63 ui_test_utils::NavigateToURL( |
| 64 browser(), GURL("chrome://theme/IDR_SETTINGS_FAVICON")); |
| 65 |
| 66 // Unknown resource |
| 67 ui_test_utils::NavigateToURL( |
| 68 browser(), GURL("chrome://theme/IDR_ASDFGHJKL")); |
| 69 } |
| 70 |
60 // Makes sure browser does not crash when the resource scale is very large. | 71 // Makes sure browser does not crash when the resource scale is very large. |
61 IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, ResourceScaleTest) { | 72 IN_PROC_BROWSER_TEST_F(ChromeURLDataManagerTest, LargeResourceScale) { |
| 73 // Valid scale |
62 ui_test_utils::NavigateToURL( | 74 ui_test_utils::NavigateToURL( |
63 browser(), GURL("chrome://theme/IDR_SETTINGS_FAVICON@2x")); | 75 browser(), GURL("chrome://theme/IDR_SETTINGS_FAVICON@2x")); |
64 | 76 |
| 77 // Unreasonably large scale |
65 ui_test_utils::NavigateToURL( | 78 ui_test_utils::NavigateToURL( |
66 browser(), GURL("chrome://theme/IDR_SETTINGS_FAVICON@99999x")); | 79 browser(), GURL("chrome://theme/IDR_SETTINGS_FAVICON@99999x")); |
67 } | 80 } |
OLD | NEW |