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

Side by Side Diff: ppapi/tests/test_websocket.cc

Issue 12252004: PPAPI/WS: use server providing hostname as test serevr hostname (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_case.html ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/tests/test_websocket.h" 5 #include "ppapi/tests/test_websocket.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 RUN_TEST_WITH_REFERENCE_CHECK(UtilityValidConnect, filter); 233 RUN_TEST_WITH_REFERENCE_CHECK(UtilityValidConnect, filter);
234 RUN_TEST_WITH_REFERENCE_CHECK(UtilityInvalidClose, filter); 234 RUN_TEST_WITH_REFERENCE_CHECK(UtilityInvalidClose, filter);
235 RUN_TEST_WITH_REFERENCE_CHECK(UtilityValidClose, filter); 235 RUN_TEST_WITH_REFERENCE_CHECK(UtilityValidClose, filter);
236 RUN_TEST_WITH_REFERENCE_CHECK(UtilityGetProtocol, filter); 236 RUN_TEST_WITH_REFERENCE_CHECK(UtilityGetProtocol, filter);
237 RUN_TEST_WITH_REFERENCE_CHECK(UtilityTextSendReceive, filter); 237 RUN_TEST_WITH_REFERENCE_CHECK(UtilityTextSendReceive, filter);
238 RUN_TEST_WITH_REFERENCE_CHECK(UtilityBinarySendReceive, filter); 238 RUN_TEST_WITH_REFERENCE_CHECK(UtilityBinarySendReceive, filter);
239 RUN_TEST_WITH_REFERENCE_CHECK(UtilityBufferedAmount, filter); 239 RUN_TEST_WITH_REFERENCE_CHECK(UtilityBufferedAmount, filter);
240 } 240 }
241 241
242 std::string TestWebSocket::GetFullURL(const char* url) { 242 std::string TestWebSocket::GetFullURL(const char* url) {
243 std::string rv = "ws://localhost"; 243 std::string rv = "ws://";
244 // Some WebSocket tests don't start the server so there'll be no port. 244 // Some WebSocket tests don't start the server so there'll be no host and
245 // port.
246 if (instance_->websocket_host().empty())
247 rv += "127.0.0.1";
248 else
249 rv += instance_->websocket_host();
245 if (instance_->websocket_port() != -1) { 250 if (instance_->websocket_port() != -1) {
246 char buffer[10]; 251 char buffer[10];
247 sprintf(buffer, ":%d", instance_->websocket_port()); 252 sprintf(buffer, ":%d", instance_->websocket_port());
248 rv += std::string(buffer); 253 rv += std::string(buffer);
249 } 254 }
250 rv += "/"; 255 rv += "/";
251 rv += url; 256 rv += url;
252 return rv; 257 return rv;
253 } 258 }
254 259
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 size_t last_event = events_on_closed - 1; 1510 size_t last_event = events_on_closed - 1;
1506 for (uint32_t i = 1; i < last_event; ++i) { 1511 for (uint32_t i = 1; i < last_event; ++i) {
1507 ASSERT_EQ(WebSocketEvent::EVENT_MESSAGE, events[i].event_type); 1512 ASSERT_EQ(WebSocketEvent::EVENT_MESSAGE, events[i].event_type);
1508 ASSERT_TRUE(AreEqualWithString(events[i].var.pp_var(), message)); 1513 ASSERT_TRUE(AreEqualWithString(events[i].var.pp_var(), message));
1509 } 1514 }
1510 ASSERT_EQ(WebSocketEvent::EVENT_CLOSE, events[last_event].event_type); 1515 ASSERT_EQ(WebSocketEvent::EVENT_CLOSE, events[last_event].event_type);
1511 ASSERT_TRUE(events[last_event].was_clean); 1516 ASSERT_TRUE(events[last_event].was_clean);
1512 1517
1513 PASS(); 1518 PASS();
1514 } 1519 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_case.html ('k') | ppapi/tests/testing_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698