tests/ceftests/values_unittest.cc
// Test get/set of a CefValue binary type.
Test get/set of a CefValue binary type.
Test get / set of a CefValue binary type .
TEST(ValuesTest, ValueBinary) {
  CefRefPtr<CefBinaryValue> binary_value = CreateBinaryValue();
  CefRefPtr<CefValue> value = CefValue::Create();
  EXPECT_TRUE(value->SetBinary(binary_value));
  EXPECT_EQ(VTYPE_BINARY, value->GetType());
  EXPECT_TRUE(value->IsValid());
  EXPECT_TRUE(value->IsReadOnly());  
  EXPECT_FALSE(value->IsOwned());
  CreateAndCompareCopy(value);
  CefRefPtr<CefBinaryValue> binary_value2 = value->GetBinary();
  EXPECT_TRUE(binary_value2.get());
  EXPECT_TRUE(binary_value2->IsValid());
  EXPECT_FALSE(binary_value2->IsOwned());
  TestBinaryEqual(binary_value, binary_value2);
  EXPECT_TRUE(binary_value->IsSame(binary_value2));
  EXPECT_TRUE(binary_value2->IsSame(binary_value));
}
TEST ( ValuesTest , ValueBinary ) { CefRefPtr < CefBinaryValue > binary_value = CreateBinaryValue ( ) ; CefRefPtr < CefValue > value = CefValue :: Create ( ) ; EXPECT_TRUE ( value -> SetBinary ( binary_value ) ) ; EXPECT_EQ ( VTYPE_BINARY , value -> GetType ( ) ) ; EXPECT_TRUE ( value -> IsValid ( ) ) ; EXPECT_TRUE ( value -> IsReadOnly ( ) ) ; EXPECT_FALSE ( value -> IsOwned ( ) ) ; CreateAndCompareCopy ( value ) ; CefRefPtr < CefBinaryValue > binary_value2 = value -> GetBinary ( ) ; EXPECT_TRUE ( binary_value2 . get ( ) ) ; EXPECT_TRUE ( binary_value2 -> IsValid ( ) ) ; EXPECT_FALSE ( binary_value2 -> IsOwned ( ) ) ; TestBinaryEqual ( binary_value , binary_value2 ) ; EXPECT_TRUE ( binary_value -> IsSame ( binary_value2 ) ) ; EXPECT_TRUE ( binary_value2 -> IsSame ( binary_value ) ) ; }
Test get/set of a CefValue binary type.
Test get / set of a CefValue binary type .
// Create the binary. // Create the value. // Binary values are always read-only. // Get the binary reference from the value. // The binaries are the same and equal.