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

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

Issue 2814012: Split part of about_handler into chrome/common to break the browser-renderer ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: with unit test Created 10 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/chrome_common.gypi » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/scoped_ptr.h" 6 #include "base/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/url_constants.h" 9 #include "chrome/common/url_constants.h"
9 #include "chrome/renderer/about_handler.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 TEST(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) { 13 TEST(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) {
14 struct AboutURLTestData { 14 struct AboutURLTestData {
15 GURL test_url; 15 GURL test_url;
16 GURL result_url; 16 GURL result_url;
17 bool about_handled; 17 bool about_handled;
18 bool browser_handled; 18 bool browser_handled;
19 } test_data[] = { 19 } test_data[] = {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 { 80 {
81 GURL("about:mars"), 81 GURL("about:mars"),
82 GURL("chrome://about/mars"), 82 GURL("chrome://about/mars"),
83 false, 83 false,
84 true 84 true
85 }, 85 },
86 }; 86 };
87 87
88 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) { 88 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) {
89 GURL url(test_data[i].test_url); 89 GURL url(test_data[i].test_url);
90 EXPECT_EQ(test_data[i].about_handled, AboutHandler::WillHandle(url)); 90 EXPECT_EQ(test_data[i].about_handled,
91 chrome_about_handler::WillHandle(url));
91 EXPECT_EQ(test_data[i].browser_handled, 92 EXPECT_EQ(test_data[i].browser_handled,
92 WillHandleBrowserAboutURL(&url, NULL)); 93 WillHandleBrowserAboutURL(&url, NULL));
93 EXPECT_EQ(test_data[i].result_url, url); 94 EXPECT_EQ(test_data[i].result_url, url);
94 } 95 }
95 96
96 // Crash the browser process for about:inducebrowsercrashforrealz. 97 // Crash the browser process for about:inducebrowsercrashforrealz.
97 GURL url(chrome::kAboutBrowserCrash); 98 GURL url(chrome::kAboutBrowserCrash);
98 EXPECT_DEATH(WillHandleBrowserAboutURL(&url, NULL), ""); 99 EXPECT_DEATH(WillHandleBrowserAboutURL(&url, NULL), "");
99 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_about_handler.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698