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

Side by Side Diff: chrome/browser/browser_about_handler_unittest.cc

Issue 8623001: Move remaining about: handlers to webUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "chrome/browser/browser_about_handler.h" 7 #include "chrome/browser/browser_about_handler.h"
8 #include "chrome/common/about_handler.h" 8 #include "chrome/common/about_handler.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 GURL(chrome_prefix + chrome::kChromeUIShorthangHost), 59 GURL(chrome_prefix + chrome::kChromeUIShorthangHost),
60 GURL(chrome_prefix + chrome::kChromeUIShorthangHost), 60 GURL(chrome_prefix + chrome::kChromeUIShorthangHost),
61 true, 61 true,
62 false 62 false
63 }, 63 },
64 { 64 {
65 GURL(chrome_prefix + chrome::kChromeUIMemoryHost), 65 GURL(chrome_prefix + chrome::kChromeUIMemoryHost),
66 GURL(chrome_prefix + chrome::kChromeUIMemoryHost), 66 GURL(chrome_prefix + chrome::kChromeUIMemoryHost),
67 false, 67 false,
68 true 68 false
69 }, 69 },
70 { 70 {
71 GURL(chrome_prefix + chrome::kChromeUIDefaultHost), 71 GURL(chrome_prefix + chrome::kChromeUIDefaultHost),
72 GURL(chrome_prefix + chrome::kChromeUIVersionHost), 72 GURL(chrome_prefix + chrome::kChromeUIVersionHost),
73 false, 73 false,
74 true 74 false
75 }, 75 },
76 { 76 {
77 GURL(chrome_prefix + chrome::kChromeUIAboutHost), 77 GURL(chrome_prefix + chrome::kChromeUIAboutHost),
78 GURL(chrome_prefix + chrome::kChromeUIChromeURLsHost), 78 GURL(chrome_prefix + chrome::kChromeUIChromeURLsHost),
79 false, 79 false,
80 true 80 false
81 }, 81 },
82 { 82 {
83 GURL(chrome_prefix + chrome::kChromeUICacheHost), 83 GURL(chrome_prefix + chrome::kChromeUICacheHost),
84 GURL(chrome_prefix + chrome::kChromeUINetworkViewCacheHost), 84 GURL(chrome_prefix + chrome::kChromeUINetworkViewCacheHost),
85 false, 85 false,
86 true 86 false
87 }, 87 },
88 { 88 {
89 GURL(chrome_prefix + chrome::kChromeUIGpuHost), 89 GURL(chrome_prefix + chrome::kChromeUIGpuHost),
90 GURL(chrome_prefix + chrome::kChromeUIGpuInternalsHost), 90 GURL(chrome_prefix + chrome::kChromeUIGpuInternalsHost),
91 false, 91 false,
92 true 92 false
93 }, 93 },
94 { 94 {
95 GURL(chrome_prefix + chrome::kChromeUISyncHost), 95 GURL(chrome_prefix + chrome::kChromeUISyncHost),
96 GURL(chrome_prefix + chrome::kChromeUISyncInternalsHost), 96 GURL(chrome_prefix + chrome::kChromeUISyncInternalsHost),
97 false, 97 false,
98 true 98 false
99 }, 99 },
100 { 100 {
101 GURL(chrome_prefix + "host/path?query#ref"), 101 GURL(chrome_prefix + "host/path?query#ref"),
102 GURL(chrome_prefix + "host/path?query#ref"), 102 GURL(chrome_prefix + "host/path?query#ref"),
103 false, 103 false,
104 true 104 false
105 } 105 }
106 }; 106 };
107 MessageLoopForUI message_loop; 107 MessageLoopForUI message_loop;
108 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); 108 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
109 TestingProfile profile; 109 TestingProfile profile;
110 110
111 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) { 111 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) {
112 GURL url(test_data[i].test_url); 112 GURL url(test_data[i].test_url);
113 EXPECT_EQ(test_data[i].about_handled, 113 EXPECT_EQ(test_data[i].about_handled,
114 chrome_about_handler::WillHandle(url)); 114 chrome_about_handler::WillHandle(url));
115 EXPECT_EQ(test_data[i].browser_handled, 115 EXPECT_EQ(test_data[i].browser_handled,
116 WillHandleBrowserAboutURL(&url, &profile)); 116 WillHandleBrowserAboutURL(&url, &profile));
117 EXPECT_EQ(test_data[i].result_url, url); 117 EXPECT_EQ(test_data[i].result_url, url);
118 } 118 }
119 119
120 // Crash the browser process for chrome://inducebrowsercrashforrealz. 120 // Crash the browser process for chrome://inducebrowsercrashforrealz.
121 GURL url(chrome_prefix + chrome::kChromeUIBrowserCrashHost); 121 GURL url(chrome_prefix + chrome::kChromeUIBrowserCrashHost);
122 EXPECT_DEATH(WillHandleBrowserAboutURL(&url, NULL), ""); 122 EXPECT_DEATH(HandleNonNavigationAboutURL(url), "");
123 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698