@@ -330,18 +330,18 @@ TEST_F(ArcPropertyUtilTest, ExpandPropertyFiles) {
330
330
std::string content;
331
331
EXPECT_TRUE (
332
332
base::ReadFileToString (dest_dir.Append (" default.prop" ), &content));
333
- EXPECT_EQ (std::string (kDefaultProp ), content);
333
+ EXPECT_EQ (std::string (kDefaultProp ) + " \n " , content);
334
334
EXPECT_TRUE (base::ReadFileToString (dest_dir.Append (" build.prop" ), &content));
335
- EXPECT_EQ (std::string (kBuildProp ), content);
335
+ EXPECT_EQ (std::string (kBuildProp ) + " \n " , content);
336
336
EXPECT_TRUE (
337
337
base::ReadFileToString (dest_dir.Append (" vendor_build.prop" ), &content));
338
- EXPECT_EQ (std::string (kVendorBuildProp ), content);
338
+ EXPECT_EQ (std::string (kVendorBuildProp ) + " \n " , content);
339
339
340
340
// Expand it again, verify the previous result is cleared.
341
341
EXPECT_TRUE (ExpandPropertyFiles (source_dir, dest_dir, false , false ));
342
342
EXPECT_TRUE (
343
343
base::ReadFileToString (dest_dir.Append (" default.prop" ), &content));
344
- EXPECT_EQ (std::string (kDefaultProp ), content);
344
+ EXPECT_EQ (std::string (kDefaultProp ) + " \n " , content);
345
345
346
346
// If default.prop does not exist in the source path, it should still process
347
347
// the other files, while also ensuring that default.prop is removed from the
@@ -351,10 +351,10 @@ TEST_F(ArcPropertyUtilTest, ExpandPropertyFiles) {
351
351
EXPECT_TRUE (ExpandPropertyFiles (source_dir, dest_dir, false , false ));
352
352
353
353
EXPECT_TRUE (base::ReadFileToString (dest_dir.Append (" build.prop" ), &content));
354
- EXPECT_EQ (std::string (kBuildProp ), content);
354
+ EXPECT_EQ (std::string (kBuildProp ) + " \n " , content);
355
355
EXPECT_TRUE (
356
356
base::ReadFileToString (dest_dir.Append (" vendor_build.prop" ), &content));
357
- EXPECT_EQ (std::string (kVendorBuildProp ), content);
357
+ EXPECT_EQ (std::string (kVendorBuildProp ) + " \n " , content);
358
358
359
359
// Finally, test the case where source is valid but the dest is not.
360
360
EXPECT_FALSE (ExpandPropertyFiles (source_dir, base::FilePath (" /nonexistent" ),
@@ -496,33 +496,36 @@ TEST_F(ArcPropertyUtilTest, TestNativeBridge64Support) {
496
496
EXPECT_TRUE (ExpandPropertyFiles (source_dir, dest_dir, false , false ));
497
497
EXPECT_TRUE (
498
498
base::ReadFileToString (dest_dir.Append (" default.prop" ), &content));
499
- EXPECT_EQ (std::string (kDefaultProp ), content);
499
+ EXPECT_EQ (std::string (kDefaultProp ) + " \n " , content);
500
500
EXPECT_TRUE (base::ReadFileToString (dest_dir.Append (" build.prop" ), &content));
501
- EXPECT_EQ (std::string (kBuildProp ), content);
501
+ EXPECT_EQ (std::string (kBuildProp ) + " \n " , content);
502
502
EXPECT_TRUE (
503
503
base::ReadFileToString (dest_dir.Append (" vendor_build.prop" ), &content));
504
- EXPECT_EQ (std::string (kVendorBuildProp ), content);
504
+ EXPECT_EQ (std::string (kVendorBuildProp ) + " \n " , content);
505
505
506
506
// Expand with experiment on, verify properties are added / modified in
507
507
// build.prop but not other files.
508
508
EXPECT_TRUE (ExpandPropertyFiles (source_dir, dest_dir, false , true ));
509
509
EXPECT_TRUE (
510
510
base::ReadFileToString (dest_dir.Append (" default.prop" ), &content));
511
- EXPECT_EQ (std::string (kDefaultProp ), content);
511
+ EXPECT_EQ (std::string (kDefaultProp ) + " \n " , content);
512
512
EXPECT_TRUE (base::ReadFileToString (dest_dir.Append (" build.prop" ), &content));
513
- constexpr const char kBuildPropModified [] =
513
+ constexpr const char kBuildPropModifiedFirst [] =
514
514
" ro.baz=boo\n "
515
515
" ro.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi\n "
516
- " ro.product.cpu.abilist64=x86_64,arm64-v8a\n "
516
+ " ro.product.cpu.abilist64=x86_64,arm64-v8a\n " ;
517
+ constexpr const char kBuildPropModifiedSecond [] =
517
518
" ro.dalvik.vm.isa.arm64=x86_64\n " ;
518
- EXPECT_EQ (std::string (kBuildPropModified ), content);
519
+ EXPECT_EQ (base::StringPrintf (" %s\n %s" , kBuildPropModifiedFirst ,
520
+ kBuildPropModifiedSecond ),
521
+ content);
519
522
EXPECT_TRUE (
520
523
base::ReadFileToString (dest_dir.Append (" vendor_build.prop" ), &content));
521
524
constexpr const char kVendorBuildPropModified [] =
522
525
" ro.a=b\n "
523
526
" ro.vendor.product.cpu.abilist=x86_64,x86,arm64-v8a,armeabi-v7a,armeabi\n "
524
527
" ro.vendor.product.cpu.abilist64=x86_64,arm64-v8a\n " ;
525
- EXPECT_EQ (std::string (kVendorBuildPropModified ), content);
528
+ EXPECT_EQ (std::string (kVendorBuildPropModified ) + " \n " , content);
526
529
527
530
// Expand to a single file with experiment on, verify properties are added /
528
531
// modified as expected.
@@ -534,9 +537,10 @@ TEST_F(ArcPropertyUtilTest, TestNativeBridge64Support) {
534
537
535
538
// Verify the contents.
536
539
EXPECT_TRUE (base::ReadFileToString (dest_prop_file, &content));
537
- EXPECT_EQ (base::StringPrintf (" %s%s%s" , kDefaultProp , kBuildPropModified ,
538
- kVendorBuildPropModified ),
539
- content);
540
+ EXPECT_EQ (
541
+ base::StringPrintf (" %s%s%s%s" , kDefaultProp , kBuildPropModifiedFirst ,
542
+ kBuildPropModifiedSecond , kVendorBuildPropModified ),
543
+ content);
540
544
541
545
// Verify that unexpected property values generate an error.
542
546
constexpr const char kBuildPropUnexpected [] =
0 commit comments