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

Side by Side Diff: chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc

Issue 37683004: GTTF: Make EmbeddedTestServer always use its own thread for IO (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 WebstoreProviderTest() {} 68 WebstoreProviderTest() {}
69 virtual ~WebstoreProviderTest() {} 69 virtual ~WebstoreProviderTest() {}
70 70
71 // InProcessBrowserTest overrides: 71 // InProcessBrowserTest overrides:
72 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 72 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
73 command_line->AppendSwitchASCII(switches::kForceFieldTrials, 73 command_line->AppendSwitchASCII(switches::kForceFieldTrials,
74 "LauncherUseWebstoreSearch/Enable/"); 74 "LauncherUseWebstoreSearch/Enable/");
75 } 75 }
76 76
77 virtual void SetUpOnMainThread() OVERRIDE { 77 virtual void SetUpOnMainThread() OVERRIDE {
78 test_server_.reset(new EmbeddedTestServer( 78 test_server_.reset(new EmbeddedTestServer);
79 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
80 79
81 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); 80 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady());
82 test_server_->RegisterRequestHandler( 81 test_server_->RegisterRequestHandler(
83 base::Bind(&WebstoreProviderTest::HandleRequest, 82 base::Bind(&WebstoreProviderTest::HandleRequest,
84 base::Unretained(this))); 83 base::Unretained(this)));
85 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 84 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
86 switches::kAppsGalleryURL, test_server_->base_url().spec()); 85 switches::kAppsGalleryURL, test_server_->base_url().spec());
87 86
88 webstore_provider_.reset(new WebstoreProvider( 87 webstore_provider_.reset(new WebstoreProvider(
89 ProfileManager::GetDefaultProfile(), NULL)); 88 ProfileManager::GetDefaultProfile(), NULL));
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 #endif 231 #endif
233 IN_PROC_BROWSER_TEST_F(WebstoreProviderTest, MAYBE_SearchCache) { 232 IN_PROC_BROWSER_TEST_F(WebstoreProviderTest, MAYBE_SearchCache) {
234 EXPECT_EQ("app1 name", RunQuery("foo", kOneResult)); 233 EXPECT_EQ("app1 name", RunQuery("foo", kOneResult));
235 234
236 // No result is provided but the provider gets the result from the cache. 235 // No result is provided but the provider gets the result from the cache.
237 EXPECT_EQ("app1 name", RunQuery("foo", "")); 236 EXPECT_EQ("app1 name", RunQuery("foo", ""));
238 } 237 }
239 238
240 } // namespace test 239 } // namespace test
241 } // namespace app_list 240 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc ('k') | chrome/browser/ui/pdf/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698