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

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc

Issue 2839753005: Remove base::Value::GetAsBinary (Closed)
Patch Set: ASSERT_TRUE Created 3 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: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
index 31338257998cc7aa8e5c6aa8da148e437cb168ab..8bb91983094ba21d7a643d353514cb0c38229e3f 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
@@ -390,10 +390,9 @@ TEST_F(EPKChallengeMachineKeyTest, Success) {
std::unique_ptr<base::Value> value(
RunFunctionAndReturnSingleResult(func_.get(), CreateArgs(), browser()));
- const base::Value* response;
- ASSERT_TRUE(value->GetAsBinary(&response));
- EXPECT_EQ("response", std::string(response->GetBlob().data(),
- response->GetBlob().size()));
+ ASSERT_TRUE(value->is_blob());
+ EXPECT_EQ("response",
+ std::string(value->GetBlob().data(), value->GetBlob().size()));
}
TEST_F(EPKChallengeMachineKeyTest, KeyRegisteredSuccess) {
@@ -420,10 +419,9 @@ TEST_F(EPKChallengeMachineKeyTest, KeyRegisteredSuccess) {
std::unique_ptr<base::Value> value(RunFunctionAndReturnSingleResult(
func_.get(), CreateArgsRegister(), browser()));
- const base::Value* response;
- ASSERT_TRUE(value->GetAsBinary(&response));
- EXPECT_EQ("response", std::string(response->GetBlob().data(),
- response->GetBlob().size()));
+ ASSERT_TRUE(value->is_blob());
+ EXPECT_EQ("response",
+ std::string(value->GetBlob().data(), value->GetBlob().size()));
}
TEST_F(EPKChallengeMachineKeyTest, AttestationNotPrepared) {
@@ -595,10 +593,9 @@ TEST_F(EPKChallengeUserKeyTest, Success) {
std::unique_ptr<base::Value> value(
RunFunctionAndReturnSingleResult(func_.get(), CreateArgs(), browser()));
- const base::Value* response;
- ASSERT_TRUE(value->GetAsBinary(&response));
- EXPECT_EQ("response", std::string(response->GetBlob().data(),
- response->GetBlob().size()));
+ ASSERT_TRUE(value->is_blob());
+ EXPECT_EQ("response",
+ std::string(value->GetBlob().data(), value->GetBlob().size()));
}
TEST_F(EPKChallengeUserKeyTest, AttestationNotPrepared) {

Powered by Google App Engine
This is Rietveld 408576698