v8/third_party/inspector_protocol/crdtp/status_test.cc
Johannes Henkel 94f9ad7da6 [DevTools] Roll third_party/inspector_protocol (v8)
This adds a DCHECK into v8-inspector-session-impl.cc, covering what
we previously checked within ConvertCBORToJSON.

Upstream reviews:

"Separate the lightweight check for CBOR messages from ParseCBOR."
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2001536

"Remove Exported::writeBinary."
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2005797

New Rev: ac6919eb836521a96cc18931f0bf270d8c1b53a1

Change-Id: I52076a8f77b27c24c3afb35c40afbbe94e0ca05c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002935
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65854}
2020-01-17 22:22:08 +00:00

30 lines
1.1 KiB
C++

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "status.h"
#include "status_test_support.h"
#include "test_platform.h"
namespace v8_crdtp {
// =============================================================================
// Status and Error codes
// =============================================================================
TEST(StatusTest, StatusToASCIIString) {
Status ok_status;
EXPECT_EQ("OK", ok_status.ToASCIIString());
Status json_error(Error::JSON_PARSER_COLON_EXPECTED, 42);
EXPECT_EQ("JSON: colon expected at position 42", json_error.ToASCIIString());
Status cbor_error(Error::CBOR_TRAILING_JUNK, 21);
EXPECT_EQ("CBOR: trailing junk at position 21", cbor_error.ToASCIIString());
}
TEST(StatusTest, StatusTestSupport) {
Status ok_status;
EXPECT_THAT(ok_status, StatusIsOk());
Status json_error(Error::JSON_PARSER_COLON_EXPECTED, 42);
EXPECT_THAT(json_error, StatusIs(Error::JSON_PARSER_COLON_EXPECTED, 42));
}
} // namespace v8_crdtp