tests/ceftests/values_unittest.cc
// Test get/set of a CefValue list type.
Test get/set of a CefValue list type.
Test get / set of a CefValue list type .
TEST(ValuesTest, ValueList) {
  CefRefPtr<CefListValue> list_value = CreateListValue();
  CefRefPtr<CefValue> value = CefValue::Create();
  EXPECT_TRUE(value->SetList(list_value));
  EXPECT_EQ(VTYPE_LIST, value->GetType());
  EXPECT_TRUE(value->IsValid());
  EXPECT_FALSE(value->IsReadOnly());
  EXPECT_FALSE(value->IsOwned());
  CreateAndCompareCopy(value);
  CefRefPtr<CefListValue> list_value2 = value->GetList();
  EXPECT_TRUE(list_value2.get());
  EXPECT_TRUE(list_value2->IsValid());
  EXPECT_FALSE(list_value2->IsOwned());
  EXPECT_FALSE(list_value2->IsReadOnly());
  TestListEqual(list_value, list_value2);
  EXPECT_TRUE(list_value->IsSame(list_value2));
  EXPECT_TRUE(list_value2->IsSame(list_value));
  EXPECT_TRUE(list_value->SetString(0, kStringValue));
  EXPECT_EQ(VTYPE_STRING, list_value->GetType(0));
  EXPECT_STREQ(kStringValue, list_value->GetString(0).ToString().data());
}
TEST ( ValuesTest , ValueList ) { CefRefPtr < CefListValue > list_value = CreateListValue ( ) ; CefRefPtr < CefValue > value = CefValue :: Create ( ) ; EXPECT_TRUE ( value -> SetList ( list_value ) ) ; EXPECT_EQ ( VTYPE_LIST , value -> GetType ( ) ) ; EXPECT_TRUE ( value -> IsValid ( ) ) ; EXPECT_FALSE ( value -> IsReadOnly ( ) ) ; EXPECT_FALSE ( value -> IsOwned ( ) ) ; CreateAndCompareCopy ( value ) ; CefRefPtr < CefListValue > list_value2 = value -> GetList ( ) ; EXPECT_TRUE ( list_value2 . get ( ) ) ; EXPECT_TRUE ( list_value2 -> IsValid ( ) ) ; EXPECT_FALSE ( list_value2 -> IsOwned ( ) ) ; EXPECT_FALSE ( list_value2 -> IsReadOnly ( ) ) ; TestListEqual ( list_value , list_value2 ) ; EXPECT_TRUE ( list_value -> IsSame ( list_value2 ) ) ; EXPECT_TRUE ( list_value2 -> IsSame ( list_value ) ) ; EXPECT_TRUE ( list_value -> SetString ( 0 , kStringValue ) ) ; EXPECT_EQ ( VTYPE_STRING , list_value -> GetType ( 0 ) ) ; EXPECT_STREQ ( kStringValue , list_value -> GetString ( 0 ) . ToString ( ) . data ( ) ) ; }
Test get/set of a CefValue list type.
Test get / set of a CefValue list type .
// Create the list. // Create the value. // Get the list reference from the value. // The lists are the same and equal. // Change a value in one list and verify that it's changed in the other list.