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

Side by Side Diff: chrome/browser/chromeos/gview_request_interceptor_unittest.cc

Issue 8417015: Fix a flaky GViewRequestInterceptorTest by refreshing the plugins list before every test case. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « no previous file | no next file » | 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 <string> 5 #include <string>
6 #include <vector>
6 7
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/message_loop.h" 9 #include "base/message_loop.h"
9 #include "chrome/browser/chrome_plugin_service_filter.h" 10 #include "chrome/browser/chrome_plugin_service_filter.h"
10 #include "chrome/browser/chromeos/gview_request_interceptor.h" 11 #include "chrome/browser/chromeos/gview_request_interceptor.h"
11 #include "chrome/browser/plugin_prefs.h" 12 #include "chrome/browser/plugin_prefs.h"
12 #include "chrome/browser/plugin_prefs_factory.h" 13 #include "chrome/browser/plugin_prefs_factory.h"
13 #include "chrome/common/chrome_paths.h" 14 #include "chrome/common/chrome_paths.h"
14 #include "chrome/test/base/testing_pref_service.h" 15 #include "chrome/test/base/testing_pref_service.h"
15 #include "content/browser/mock_resource_context.h" 16 #include "content/browser/mock_resource_context.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 plugin_prefs_ = new PluginPrefs(); 94 plugin_prefs_ = new PluginPrefs();
94 plugin_prefs_->SetPrefs(&prefs_); 95 plugin_prefs_->SetPrefs(&prefs_);
95 ChromePluginServiceFilter* filter = 96 ChromePluginServiceFilter* filter =
96 ChromePluginServiceFilter::GetInstance(); 97 ChromePluginServiceFilter::GetInstance();
97 filter->RegisterResourceContext(plugin_prefs_, resource_context); 98 filter->RegisterResourceContext(plugin_prefs_, resource_context);
98 PluginService::GetInstance()->set_filter(filter); 99 PluginService::GetInstance()->set_filter(filter);
99 100
100 ASSERT_TRUE(PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path_)); 101 ASSERT_TRUE(PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path_));
101 102
102 handler_ = new content::DummyResourceHandler(); 103 handler_ = new content::DummyResourceHandler();
104
105 PluginService::GetInstance()->RefreshPluginList();
106 PluginService::GetInstance()->GetPlugins(base::Bind(&QuitMessageLoop));
107 MessageLoop::current()->Run();
103 } 108 }
104 109
105 virtual void TearDown() { 110 virtual void TearDown() {
106 plugin_prefs_->ShutdownOnUIThread(); 111 plugin_prefs_->ShutdownOnUIThread();
107 content::ResourceContext* resource_context = 112 content::ResourceContext* resource_context =
108 content::MockResourceContext::GetInstance(); 113 content::MockResourceContext::GetInstance();
109 net::URLRequestContext* request_context = 114 net::URLRequestContext* request_context =
110 resource_context->request_context(); 115 resource_context->request_context();
111 request_context->set_job_factory(old_factory_); 116 request_context->set_job_factory(old_factory_);
112 ChromePluginServiceFilter* filter = 117 ChromePluginServiceFilter* filter =
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 request.Start(); 260 request.Start();
256 MessageLoop::current()->Run(); 261 MessageLoop::current()->Run();
257 EXPECT_EQ(1, test_delegate_.received_redirect_count()); 262 EXPECT_EQ(1, test_delegate_.received_redirect_count());
258 EXPECT_EQ(GURL("http://docs.google.com/gview?url=http%3A//foo.com/file.ppt"), 263 EXPECT_EQ(GURL("http://docs.google.com/gview?url=http%3A//foo.com/file.ppt"),
259 request.url()); 264 request.url());
260 } 265 }
261 266
262 } // namespace 267 } // namespace
263 268
264 } // namespace chromeos 269 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698