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

Side by Side Diff: chrome/browser/extensions/external_provider_impl_unittest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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
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 "chrome/browser/extensions/external_provider_impl.h" 5 #include "chrome/browser/extensions/external_provider_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 int(sizeof(prefs))); 91 int(sizeof(prefs)));
92 InitializeExtensionService(params); 92 InitializeExtensionService(params);
93 service_->updater()->Start(); 93 service_->updater()->Start();
94 } 94 }
95 95
96 // ExtensionServiceTestBase overrides: 96 // ExtensionServiceTestBase overrides:
97 void SetUp() override { 97 void SetUp() override {
98 ExtensionServiceTestBase::SetUp(); 98 ExtensionServiceTestBase::SetUp();
99 test_server_.reset(new EmbeddedTestServer()); 99 test_server_.reset(new EmbeddedTestServer());
100 100
101 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); 101 ASSERT_TRUE(test_server_->Start());
102 test_server_->RegisterRequestHandler( 102 test_server_->RegisterRequestHandler(
103 base::Bind(&ExternalProviderImplTest::HandleRequest, 103 base::Bind(&ExternalProviderImplTest::HandleRequest,
104 base::Unretained(this))); 104 base::Unretained(this)));
105 105
106 test_extension_cache_.reset(new ExtensionCacheFake()); 106 test_extension_cache_.reset(new ExtensionCacheFake());
107 107
108 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); 108 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
109 cmdline->AppendSwitchASCII(switches::kAppsGalleryUpdateURL, 109 cmdline->AppendSwitchASCII(switches::kAppsGalleryUpdateURL,
110 test_server_->GetURL(kManifestPath).spec()); 110 test_server_->GetURL(kManifestPath).spec());
111 } 111 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 service_->CheckForExternalUpdates(); 170 service_->CheckForExternalUpdates();
171 runner->Run(); 171 runner->Run();
172 172
173 EXPECT_TRUE(service_->GetInstalledExtension( 173 EXPECT_TRUE(service_->GetInstalledExtension(
174 extension_misc::kInAppPaymentsSupportAppId)); 174 extension_misc::kInAppPaymentsSupportAppId));
175 EXPECT_TRUE(service_->IsExtensionEnabled( 175 EXPECT_TRUE(service_->IsExtensionEnabled(
176 extension_misc::kInAppPaymentsSupportAppId)); 176 extension_misc::kInAppPaymentsSupportAppId));
177 } 177 }
178 178
179 } // namespace extensions 179 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698