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

Unified Diff: content/browser/renderer_host/media/device_request_message_filter_unittest.cc

Issue 88283002: Reland review 34393006: Refactor MediaStreamManager to not output real device id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes since the revert. Created 7 years, 1 month 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: content/browser/renderer_host/media/device_request_message_filter_unittest.cc
diff --git a/content/browser/renderer_host/media/device_request_message_filter_unittest.cc b/content/browser/renderer_host/media/device_request_message_filter_unittest.cc
index c3ffe9576f46d5fe5d7f7cdd4469090056c95d09..13a1cdbd2f6c17db68ce802b440d54bb8128ddc3 100644
--- a/content/browser/renderer_host/media/device_request_message_filter_unittest.cc
+++ b/content/browser/renderer_host/media/device_request_message_filter_unittest.cc
@@ -6,7 +6,6 @@
#include "content/browser/renderer_host/media/device_request_message_filter.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/common/media/media_stream_messages.h"
-#include "content/public/browser/media_device_id.h"
#include "content/public/test/mock_resource_context.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -118,11 +117,6 @@ class DeviceRequestMessageFilterTest : public testing::Test {
host_->requested_devices().size());
EXPECT_EQ(kRequestId, host_->received_id());
- // Check to make sure no devices have raw ids.
- EXPECT_FALSE(DoesContainRawIds(host_->requested_devices()));
-
- // Check to make sure every GUID produced matches a raw device id.
- EXPECT_TRUE(DoesEveryDeviceMapToRawId(host_->requested_devices(), origin));
}
bool AreLabelsPresent(MediaStreamType type) {
@@ -199,48 +193,6 @@ class DeviceRequestMessageFilterTest : public testing::Test {
host_->DevicesEnumerated(kVideoLabel, physical_video_devices_);
}
- bool DoesContainRawIds(const StreamDeviceInfoArray& devices) {
- for (size_t i = 0; i < devices.size(); i++) {
- for (size_t j = 0; j < physical_audio_devices_.size(); ++j) {
- if (physical_audio_devices_[j].device.id == devices[i].device.id)
- return true;
- }
- for (size_t j = 0; j < physical_video_devices_.size(); ++j) {
- if (physical_video_devices_[j].device.id == devices[i].device.id)
- return true;
- }
- }
- return false;
- }
-
- bool DoesEveryDeviceMapToRawId(const StreamDeviceInfoArray& devices,
- const GURL& origin) {
- for (size_t i = 0; i < devices.size(); i++) {
- bool found_match = false;
- for (size_t j = 0; j < physical_audio_devices_.size(); ++j) {
- if (content::DoesMediaDeviceIDMatchHMAC(
- origin,
- devices[i].device.id,
- physical_audio_devices_[j].device.id)) {
- EXPECT_FALSE(found_match);
- found_match = true;
- }
- }
- for (size_t j = 0; j < physical_video_devices_.size(); ++j) {
- if (content::DoesMediaDeviceIDMatchHMAC(
- origin,
- devices[i].device.id,
- physical_video_devices_[j].device.id)) {
- EXPECT_FALSE(found_match);
- found_match = true;
- }
- }
- if (!found_match)
- return false;
- }
- return true;
- }
-
int next_device_id_;
};

Powered by Google App Engine
This is Rietveld 408576698