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

Side by Side Diff: third_party/protobuf/src/google/protobuf/compiler/importer_unittest.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component 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 unified diff | Download patch
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void ExpectCannotOpenFile(const string& filename, 286 void ExpectCannotOpenFile(const string& filename,
287 const string& error_message) { 287 const string& error_message) {
288 google::protobuf::scoped_ptr<io::ZeroCopyInputStream> input(source_tree_.Ope n(filename)); 288 google::protobuf::scoped_ptr<io::ZeroCopyInputStream> input(source_tree_.Ope n(filename));
289 EXPECT_TRUE(input == NULL); 289 EXPECT_TRUE(input == NULL);
290 EXPECT_EQ(error_message, source_tree_.GetLastErrorMessage()); 290 EXPECT_EQ(error_message, source_tree_.GetLastErrorMessage());
291 } 291 }
292 292
293 DiskSourceTree source_tree_; 293 DiskSourceTree source_tree_;
294 294
295 // Paths of two on-disk directories to use during the test. 295 // Paths of two on-disk directories to use during the test.
296 vector<string> dirnames_; 296 std::vector<string> dirnames_;
297 }; 297 };
298 298
299 TEST_F(DiskSourceTreeTest, MapRoot) { 299 TEST_F(DiskSourceTreeTest, MapRoot) {
300 // Test opening a file in a directory that is mapped to the root of the 300 // Test opening a file in a directory that is mapped to the root of the
301 // source tree. 301 // source tree.
302 AddFile(dirnames_[0] + "/foo", "Hello World!"); 302 AddFile(dirnames_[0] + "/foo", "Hello World!");
303 source_tree_.MapPath("", dirnames_[0]); 303 source_tree_.MapPath("", dirnames_[0]);
304 304
305 ExpectFileContents("foo", "Hello World!"); 305 ExpectFileContents("foo", "Hello World!");
306 ExpectCannotOpenFile("bar", "File not found."); 306 ExpectCannotOpenFile("bar", "File not found.");
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // Accept NULL as output parameter. 514 // Accept NULL as output parameter.
515 EXPECT_TRUE(source_tree_.VirtualFileToDiskFile("bar/foo", NULL)); 515 EXPECT_TRUE(source_tree_.VirtualFileToDiskFile("bar/foo", NULL));
516 EXPECT_FALSE(source_tree_.VirtualFileToDiskFile("baz/foo", NULL)); 516 EXPECT_FALSE(source_tree_.VirtualFileToDiskFile("baz/foo", NULL));
517 } 517 }
518 518
519 } // namespace 519 } // namespace
520 520
521 } // namespace compiler 521 } // namespace compiler
522 } // namespace protobuf 522 } // namespace protobuf
523 } // namespace google 523 } // namespace google
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698