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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (!WaitFor(api::OnCreated::kEventName, on_created_event)) 356 if (!WaitFor(api::OnCreated::kEventName, on_created_event))
357 return false; 357 return false;
358 // Now, onCreated is always fired before interruption. 358 // Now, onCreated is always fired before interruption.
359 return WaitFor(api::OnChanged::kEventName, 359 return WaitFor(api::OnChanged::kEventName,
360 base::StringPrintf("[{\"id\": %d," 360 base::StringPrintf("[{\"id\": %d,"
361 " \"error\": {\"current\": \"%s\"}," 361 " \"error\": {\"current\": \"%s\"},"
362 " \"state\": {" 362 " \"state\": {"
363 " \"previous\": \"in_progress\"," 363 " \"previous\": \"in_progress\","
364 " \"current\": \"interrupted\"}}]", 364 " \"current\": \"interrupted\"}}]",
365 item->GetId(), 365 item->GetId(),
366 content::InterruptReasonDebugString( 366 content::DownloadInterruptReasonToString(
367 expected_error).c_str())); 367 expected_error).c_str()));
368 } 368 }
369 369
370 void ClearEvents() { 370 void ClearEvents() {
371 events_listener_->ClearEvents(); 371 events_listener_->ClearEvents();
372 } 372 }
373 373
374 std::string GetExtensionURL() { 374 std::string GetExtensionURL() {
375 return extension_->url().spec(); 375 return extension_->url().spec();
376 } 376 }
(...skipping 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3596 &conflict_action, 3596 &conflict_action,
3597 &warnings); 3597 &warnings);
3598 EXPECT_EQ("suggester", winner_id); 3598 EXPECT_EQ("suggester", winner_id);
3599 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); 3599 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value());
3600 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); 3600 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action);
3601 EXPECT_FALSE(warnings.empty()); 3601 EXPECT_FALSE(warnings.empty());
3602 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, 3602 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict,
3603 warnings.begin()->warning_type()); 3603 warnings.begin()->warning_type());
3604 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); 3604 EXPECT_EQ("incumbent", warnings.begin()->extension_id());
3605 } 3605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698