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

Unified Diff: src/platform/update_engine/test_utils.h

Issue 1694025: AU: Update Downloader to support our image formats. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/update_engine/split_file_writer.cc ('k') | src/platform/update_engine/update_attempter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/test_utils.h
diff --git a/src/platform/update_engine/test_utils.h b/src/platform/update_engine/test_utils.h
index 4bc107e03e23ed41d50fdbb403e130e756a52281..ca797d96508c3870324d088207d7d91946a6cb58 100644
--- a/src/platform/update_engine/test_utils.h
+++ b/src/platform/update_engine/test_utils.h
@@ -9,8 +9,10 @@
#include <string>
#include <vector>
#include <gtest/gtest.h>
+#include "base/scoped_ptr.h"
#include "update_engine/action.h"
#include "update_engine/subprocess.h"
+#include "update_engine/utils.h"
// These are some handy functions for unittests.
@@ -119,6 +121,20 @@ class ScopedLoopbackDeviceReleaser {
DISALLOW_COPY_AND_ASSIGN(ScopedLoopbackDeviceReleaser);
};
+class ScopedTempFile {
+ public:
+ ScopedTempFile() {
+ EXPECT_TRUE(utils::MakeTempFile("/tmp/update_engine_test_temp_file.XXXXXX",
+ &path_,
+ NULL));
+ unlinker_.reset(new ScopedPathUnlinker(path_));
+ }
+ const std::string& GetPath() { return path_; }
+ private:
+ std::string path_;
+ scoped_ptr<ScopedPathUnlinker> unlinker_;
+};
+
// Useful actions for test
class NoneType;
@@ -191,4 +207,4 @@ struct ObjectCollectorAction : public Action<ObjectCollectorAction<T> > {
} // namespace chromeos_update_engine
-#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_TEST_UTILS_H__
« no previous file with comments | « src/platform/update_engine/split_file_writer.cc ('k') | src/platform/update_engine/update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698