Skip to content

Commit

Permalink
Cherry pick PR #660: Delete crashing CobaltMetricsLogUploader test (#736
Browse files Browse the repository at this point in the history
)

This test what might happen if a non-gzipped payload gets sent by Chromium to
our libraries. This payload being compressed is fundamental to the API provided
by the underlying Chromium libraries and will not change. If it does, that's a
wider refactor and would break a lot of stuff. It's kind of just testing the
public API stays the same of //components/metrics, which really isn't a good
unit test.

b/287972956

Change-Id: I3690b93ac8fd3a26742ae41a6fca931c29cf9c5e
(cherry picked from commit a8a235c)

Co-authored-by: Joel Martinez <[email protected]>
Co-authored-by: Joel Martinez <[email protected]>
  • Loading branch information
3 people authored Jun 27, 2023
1 parent 1991549 commit cb5ee08
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions cobalt/browser/metrics/cobalt_metrics_log_uploader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,6 @@ TEST_F(CobaltMetricsLogUploaderTest, UnknownMetricTypeDoesntTriggerUpload) {
ASSERT_EQ(callback_count_, 1);
}

TEST_F(CobaltMetricsLogUploaderTest, BadCompressedDataSendsEmptyString) {
StrictMock<MockMetricsUploaderCallback> mock_upload_handler;
uploader_->SetOnUploadHandler(&mock_upload_handler);
::metrics::ReportingInfo dummy_reporting_info;
EXPECT_CALL(mock_upload_handler, Run(_, Eq(""))).Times(1);
// "bad data" isn't a compressed serialized proto, should just try to upload
// empty string.
uploader_->UploadLog("bad data", "fake_hash", dummy_reporting_info);
ASSERT_EQ(callback_count_, 1);
}

} // namespace metrics
} // namespace browser
} // namespace cobalt

0 comments on commit cb5ee08

Please sign in to comment.