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

Unified Diff: courgette/base_test_unittest.cc

Issue 8252011: Add a basic backwards compatibility unittest. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix review nits. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: courgette/base_test_unittest.cc
diff --git a/courgette/base_test_unittest.cc b/courgette/base_test_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6da56fb98591b4021752f2191ec8c90a6df82875
--- /dev/null
+++ b/courgette/base_test_unittest.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2011 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 "courgette/base_test_unittest.h"
+
+#include "base/path_service.h"
+
+void BaseTest::SetUp() {
+ PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_);
Paweł Hajdan Jr. 2011/10/19 08:46:39 Please check return value.
+ test_dir_ = test_dir_.AppendASCII("courgette");
+ test_dir_ = test_dir_.AppendASCII("testdata");
+}
+
+void BaseTest::TearDown() {
+}
+
+// Reads a test file into a string.
+std::string BaseTest::FileContents(const char* file_name) const {
+ FilePath file_path = test_dir_;
+ file_path = file_path.AppendASCII(file_name);
+ std::string file_bytes;
+
+ EXPECT_TRUE(file_util::ReadFileToString(file_path, &file_bytes));
Paweł Hajdan Jr. 2011/10/19 08:46:39 Not sure if this test is valuable at all.
+
+ return file_bytes;
+}

Powered by Google App Engine
This is Rietveld 408576698