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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/chrome_plugin_service_filter.h" | 10 #include "chrome/browser/chrome_plugin_service_filter.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 plugin_prefs_->EnablePlugin(false, pdf_path_); | 237 plugin_prefs_->EnablePlugin(false, pdf_path_); |
238 | 238 |
239 net::URLRequest request(GURL(kPdfUrl), &test_delegate_); | 239 net::URLRequest request(GURL(kPdfUrl), &test_delegate_); |
240 SetupRequest(&request); | 240 SetupRequest(&request); |
241 request.Start(); | 241 request.Start(); |
242 MessageLoop::current()->Run(); | 242 MessageLoop::current()->Run(); |
243 EXPECT_EQ(1, test_delegate_.received_redirect_count()); | 243 EXPECT_EQ(1, test_delegate_.received_redirect_count()); |
244 EXPECT_EQ(GURL(kPdfUrlIntercepted), request.url()); | 244 EXPECT_EQ(GURL(kPdfUrlIntercepted), request.url()); |
245 } | 245 } |
246 | 246 |
247 TEST_F(GViewRequestInterceptorTest, InterceptPdfWithNoPlugin) { | 247 #if defined(OFFICIAL_BUILD) |
Lei Zhang
2011/11/17 01:40:09
just put: #if !defined(OFFICIAL_BUILD) around the
tbarzic
2011/11/17 01:49:00
Done.
| |
248 #define MAYBE_InterceptPdfWithNoPlugin DISABLED_InterceptPdfWithNoPLugin | |
249 #else | |
250 #define MAYBE_InterceptPdfWithNoPlugin InterceptPdfWithNoPlugin | |
251 #endif | |
252 | |
253 TEST_F(GViewRequestInterceptorTest, MAYBE_InterceptPdfWithNoPlugin) { | |
248 SetPDFPluginLoadedState(false); | 254 SetPDFPluginLoadedState(false); |
249 | 255 |
250 net::URLRequest request(GURL(kPdfUrl), &test_delegate_); | 256 net::URLRequest request(GURL(kPdfUrl), &test_delegate_); |
251 SetupRequest(&request); | 257 SetupRequest(&request); |
252 request.Start(); | 258 request.Start(); |
253 MessageLoop::current()->Run(); | 259 MessageLoop::current()->Run(); |
254 EXPECT_EQ(1, test_delegate_.received_redirect_count()); | 260 EXPECT_EQ(1, test_delegate_.received_redirect_count()); |
255 EXPECT_EQ(GURL(kPdfUrlIntercepted), request.url()); | 261 EXPECT_EQ(GURL(kPdfUrlIntercepted), request.url()); |
256 } | 262 } |
257 | 263 |
(...skipping 25 matching lines...) Expand all Loading... | |
283 SetupRequest(&request); | 289 SetupRequest(&request); |
284 request.Start(); | 290 request.Start(); |
285 MessageLoop::current()->Run(); | 291 MessageLoop::current()->Run(); |
286 EXPECT_EQ(0, test_delegate_.received_redirect_count()); | 292 EXPECT_EQ(0, test_delegate_.received_redirect_count()); |
287 EXPECT_EQ(GURL(kPdfBlob), request.url()); | 293 EXPECT_EQ(GURL(kPdfBlob), request.url()); |
288 } | 294 } |
289 | 295 |
290 } // namespace | 296 } // namespace |
291 | 297 |
292 } // namespace chromeos | 298 } // namespace chromeos |
OLD | NEW |