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

Unified Diff: components/offline_pages/offline_page_test_archiver.cc

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_test_archiver.cc
diff --git a/components/offline_pages/offline_page_test_archiver.cc b/components/offline_pages/offline_page_test_archiver.cc
deleted file mode 100644
index 8ee7f37cd2c3fbb07715016ddb4a9795091186aa..0000000000000000000000000000000000000000
--- a/components/offline_pages/offline_page_test_archiver.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/offline_pages/offline_page_test_archiver.h"
-
-#include "base/bind.h"
-#include "base/files/file_util.h"
-#include "base/location.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace offline_pages {
-
-OfflinePageTestArchiver::OfflinePageTestArchiver(
- Observer* observer,
- const GURL& url,
- ArchiverResult result,
- const base::string16& result_title,
- int64_t size_to_report,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
- : observer_(observer),
- url_(url),
- result_(result),
- size_to_report_(size_to_report),
- create_archive_called_(false),
- delayed_(false),
- result_title_(result_title),
- task_runner_(task_runner) {}
-
-OfflinePageTestArchiver::~OfflinePageTestArchiver() {
- EXPECT_TRUE(create_archive_called_);
-}
-
-void OfflinePageTestArchiver::CreateArchive(
- const base::FilePath& archives_dir,
- int64_t archive_id,
- const CreateArchiveCallback& callback) {
- create_archive_called_ = true;
- callback_ = callback;
- archives_dir_ = archives_dir;
- if (!delayed_)
- CompleteCreateArchive();
-}
-
-void OfflinePageTestArchiver::CompleteCreateArchive() {
- DCHECK(!callback_.is_null());
- base::FilePath archive_path;
- if (filename_.empty()) {
- ASSERT_TRUE(base::CreateTemporaryFileInDir(archives_dir_, &archive_path));
- } else {
- archive_path = archives_dir_.Append(filename_);
- // This step ensures the file is created and closed immediately.
- base::File file(archive_path, base::File::FLAG_OPEN_ALWAYS);
- }
- observer_->SetLastPathCreatedByArchiver(archive_path);
- task_runner_->PostTask(
- FROM_HERE, base::Bind(callback_, this, result_, url_, archive_path,
- result_title_, size_to_report_));
-}
-
-} // namespace offline_pages
« no previous file with comments | « components/offline_pages/offline_page_test_archiver.h ('k') | components/offline_pages/offline_page_test_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698