OLD | NEW |
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/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
9 #include "chrome/common/about_handler.h" | 9 #include "chrome/common/about_handler.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 11 #include "chrome/test/testing_browser_process_test.h" |
11 #include "chrome/test/testing_profile.h" | 12 #include "chrome/test/testing_profile.h" |
12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 TEST(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) { | 16 typedef TestingBrowserProcessTest BrowserAboutHandlerTest; |
| 17 |
| 18 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) { |
16 struct AboutURLTestData { | 19 struct AboutURLTestData { |
17 GURL test_url; | 20 GURL test_url; |
18 GURL result_url; | 21 GURL result_url; |
19 bool about_handled; | 22 bool about_handled; |
20 bool browser_handled; | 23 bool browser_handled; |
21 } test_data[] = { | 24 } test_data[] = { |
22 { | 25 { |
23 GURL("http://google.com"), | 26 GURL("http://google.com"), |
24 GURL("http://google.com"), | 27 GURL("http://google.com"), |
25 false, | 28 false, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 chrome_about_handler::WillHandle(url)); | 111 chrome_about_handler::WillHandle(url)); |
109 EXPECT_EQ(test_data[i].browser_handled, | 112 EXPECT_EQ(test_data[i].browser_handled, |
110 WillHandleBrowserAboutURL(&url, &profile)); | 113 WillHandleBrowserAboutURL(&url, &profile)); |
111 EXPECT_EQ(test_data[i].result_url, url); | 114 EXPECT_EQ(test_data[i].result_url, url); |
112 } | 115 } |
113 | 116 |
114 // Crash the browser process for about:inducebrowsercrashforrealz. | 117 // Crash the browser process for about:inducebrowsercrashforrealz. |
115 GURL url(chrome::kAboutBrowserCrash); | 118 GURL url(chrome::kAboutBrowserCrash); |
116 EXPECT_DEATH(WillHandleBrowserAboutURL(&url, NULL), ""); | 119 EXPECT_DEATH(WillHandleBrowserAboutURL(&url, NULL), ""); |
117 } | 120 } |
OLD | NEW |