Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc

Issue 2279293004: Fix DCHECK in debug build when navigating to an unknown chrome://theme/ URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace NotifyCanceled() with stored error value Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/webui/url_data_manager_backend.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"));
mmenke 2016/08/30 14:42:38 optional: Maybe run Javascript to make sure the p
Peter Kasting 2016/08/30 19:46:07 That's all true, but I think the more important qu
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 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/webui/url_data_manager_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698