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

Unified Diff: components/cast_certificate/cast_cert_validator_test_helpers.cc

Issue 1924323002: Move Cast certificate verification code from extensions to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified OWNERS files Created 4 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
Index: components/cast_certificate/cast_cert_validator_test_helpers.cc
diff --git a/extensions/common/cast/cast_cert_validator_test_helpers.cc b/components/cast_certificate/cast_cert_validator_test_helpers.cc
similarity index 78%
rename from extensions/common/cast/cast_cert_validator_test_helpers.cc
rename to components/cast_certificate/cast_cert_validator_test_helpers.cc
index 1ebbfbd211d90152b47c96e7c4683d8c988054af..78c092b1e6ebcbdd58db013b0f52140a73537810 100644
--- a/extensions/common/cast/cast_cert_validator_test_helpers.cc
+++ b/components/cast_certificate/cast_cert_validator_test_helpers.cc
@@ -2,26 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "extensions/common/cast/cast_cert_validator_test_helpers.h"
+#include "components/cast_certificate/cast_cert_validator_test_helpers.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
-#include "extensions/common/extension_paths.h"
#include "net/cert/pem_tokenizer.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace cast_test_helpers {
+namespace cast_certificate {
+
+namespace testing {
namespace {
-// Reads a file from the extensions test data directory
-// (//src/extensions/test/data/)
+// Reads a file from the test data directory
+// (//src/components/test/data/cast_certificate)
std::string ReadTestFileToString(const base::StringPiece& file_name) {
base::FilePath filepath;
- if (!PathService::Get(extensions::DIR_TEST_DATA, &filepath)) {
- ADD_FAILURE() << "Couldn't retrieve test data root";
- return std::string();
- }
+ PathService::Get(base::DIR_SOURCE_ROOT, &filepath);
+ filepath = filepath.Append(FILE_PATH_LITERAL("components"));
+ filepath = filepath.Append(FILE_PATH_LITERAL("test"));
+ filepath = filepath.Append(FILE_PATH_LITERAL("data"));
+ filepath = filepath.Append(FILE_PATH_LITERAL("cast_certificate"));
filepath = filepath.AppendASCII(file_name);
// Read the full contents of the file.
@@ -84,4 +86,6 @@ SignatureTestData ReadSignatureTestData(const base::StringPiece& file_name) {
return result;
}
-} // namespace cast_test_helpers
+} // namespace testing
+
+} // namespace cast_certificate

Powered by Google App Engine
This is Rietveld 408576698