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

Side by Side Diff: chrome/browser/download/download_browsertest.cc

Issue 8890086: Issue 71980: Extensions code should use UTF-16 for user-visible Unicode strings (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 | « AUTHORS ('k') | chrome/browser/extensions/convert_user_script.h » ('j') | 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 public: 218 public:
219 MockAbortExtensionInstallUI() : ExtensionInstallUI(NULL) {} 219 MockAbortExtensionInstallUI() : ExtensionInstallUI(NULL) {}
220 220
221 // Simulate a user abort on an extension installation. 221 // Simulate a user abort on an extension installation.
222 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { 222 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) {
223 delegate->InstallUIAbort(true); 223 delegate->InstallUIAbort(true);
224 MessageLoopForUI::current()->Quit(); 224 MessageLoopForUI::current()->Quit();
225 } 225 }
226 226
227 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {} 227 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {}
228 virtual void OnInstallFailure(const std::string& error) {} 228 virtual void OnInstallFailure(const string16& error) {}
229 }; 229 };
230 230
231 // Mock that simulates a permissions dialog where the user allows 231 // Mock that simulates a permissions dialog where the user allows
232 // installation. 232 // installation.
233 class MockAutoConfirmExtensionInstallUI : public ExtensionInstallUI { 233 class MockAutoConfirmExtensionInstallUI : public ExtensionInstallUI {
234 public: 234 public:
235 explicit MockAutoConfirmExtensionInstallUI(Profile* profile) 235 explicit MockAutoConfirmExtensionInstallUI(Profile* profile)
236 : ExtensionInstallUI(profile) {} 236 : ExtensionInstallUI(profile) {}
237 237
238 // Proceed without confirmation prompt. 238 // Proceed without confirmation prompt.
239 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { 239 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) {
240 delegate->InstallUIProceed(); 240 delegate->InstallUIProceed();
241 } 241 }
242 242
243 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {} 243 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {}
244 virtual void OnInstallFailure(const std::string& error) {} 244 virtual void OnInstallFailure(const string16& error) {}
245 }; 245 };
246 246
247 static DownloadManager* DownloadManagerForBrowser(Browser* browser) { 247 static DownloadManager* DownloadManagerForBrowser(Browser* browser) {
248 return DownloadServiceFactory::GetForProfile(browser->profile()) 248 return DownloadServiceFactory::GetForProfile(browser->profile())
249 ->GetDownloadManager(); 249 ->GetDownloadManager();
250 } 250 }
251 251
252 } // namespace 252 } // namespace
253 253
254 // While an object of this class exists, it will mock out download 254 // While an object of this class exists, it will mock out download
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 1729
1730 // Check state. 1730 // Check state.
1731 EXPECT_EQ(1, browser()->tab_count()); 1731 EXPECT_EQ(1, browser()->tab_count());
1732 ASSERT_TRUE(CheckDownloadFullPaths(browser(), 1732 ASSERT_TRUE(CheckDownloadFullPaths(browser(),
1733 target_file_full_path, 1733 target_file_full_path,
1734 OriginFile(file))); 1734 OriginFile(file)));
1735 1735
1736 // Temporary downloads won't be visible. 1736 // Temporary downloads won't be visible.
1737 CheckDownloadUI(browser(), false, false, file); 1737 CheckDownloadUI(browser(), false, false, file);
1738 } 1738 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | chrome/browser/extensions/convert_user_script.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698