Commit 7f5a2800 authored by ckehoe's avatar ckehoe Committed by Commit bot

This CL repairs a linker error which prevented us from checking in the full...

This CL repairs a linker error which prevented us from checking in the full copresence implementation under Windows.

BUG=407466

Review URL: https://codereview.chromium.org/503253002

Cr-Commit-Position: refs/heads/master@{#291940}
parent 4d065e13
......@@ -11,7 +11,15 @@
#include "base/guid.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
// TODO(ckehoe): time.h includes windows.h, which #defines DeviceCapabilities
// to DeviceCapabilitiesW. This breaks the pb.h headers below. For now,
// we fix this with an #undef.
#include "base/time/time.h"
#if defined(OS_WIN)
#undef DeviceCapabilities
#endif
#include "components/copresence/copresence_switches.h"
#include "components/copresence/handlers/directive_handler.h"
#include "components/copresence/proto/codes.pb.h"
......@@ -162,8 +170,6 @@ bool ExtractIsAudibleStrategy(const ReportRequest& request) {
scoped_ptr<DeviceState> GetDeviceCapabilities(const ReportRequest& request) {
scoped_ptr<DeviceState> state(new DeviceState);
// TODO(ckehoe): Currently this code causes a linker error on Windows.
#ifndef OS_WIN
TokenTechnology* token_technology =
state->mutable_capabilities()->add_token_technology();
token_technology->set_medium(AUDIO_ULTRASOUND_PASSBAND);
......@@ -176,7 +182,6 @@ scoped_ptr<DeviceState> GetDeviceCapabilities(const ReportRequest& request) {
token_technology->add_instruction_type(TRANSMIT);
if (config == SCAN_ONLY || config == BROADCAST_AND_SCAN)
token_technology->add_instruction_type(RECEIVE);
#endif
return state.Pass();
}
......
......@@ -108,13 +108,10 @@ class RpcHandlerTest : public testing::Test, public CopresenceDelegate {
return static_cast<ReportRequest*>(request_proto_.get());
}
// TODO(ckehoe): Fix this on Windows. See rpc_handler.cc.
#ifndef OS_WIN
const TokenTechnology& GetTokenTechnologyFromReport() {
return GetReportSent()->update_signals_request().state().capabilities()
.token_technology(0);
}
#endif
const RepeatedPtrField<PublishedMessage>& GetMessagesPublished() {
return GetReportSent()->manage_messages_request().message_to_publish();
......@@ -204,9 +201,6 @@ TEST_F(RpcHandlerTest, Initialize) {
EXPECT_FALSE(identity.chrome_id().empty());
}
// TODO(ckehoe): Fix this on Windows. See rpc_handler.cc.
#ifndef OS_WIN
TEST_F(RpcHandlerTest, GetDeviceCapabilities) {
// Empty request.
rpc_handler_.SendReportRequest(make_scoped_ptr(new ReportRequest));
......@@ -254,7 +248,6 @@ TEST_F(RpcHandlerTest, GetDeviceCapabilities) {
EXPECT_EQ(TRANSMIT, token_technology->instruction_type(0));
EXPECT_EQ(RECEIVE, token_technology->instruction_type(1));
}
#endif
TEST_F(RpcHandlerTest, CreateRequestHeader) {
SetDeviceId("CreateRequestHeader Device ID");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment