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

Side by Side Diff: content/browser/service_worker/service_worker_version_unittest.cc

Issue 2023243002: Remove base::Tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint fix Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/service_worker/service_worker_version.h" 5 #include "content/browser/service_worker/service_worker_version.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <tuple>
8 9
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
11 #include "base/run_loop.h" 12 #include "base/run_loop.h"
12 #include "content/browser/service_worker/embedded_worker_registry.h" 13 #include "content/browser/service_worker/embedded_worker_registry.h"
13 #include "content/browser/service_worker/embedded_worker_test_helper.h" 14 #include "content/browser/service_worker/embedded_worker_test_helper.h"
14 #include "content/browser/service_worker/service_worker_context_core.h" 15 #include "content/browser/service_worker/service_worker_context_core.h"
15 #include "content/browser/service_worker/service_worker_registration.h" 16 #include "content/browser/service_worker/service_worker_registration.h"
16 #include "content/browser/service_worker/service_worker_test_utils.h" 17 #include "content/browser/service_worker/service_worker_test_utils.h"
17 #include "content/common/service_worker/service_worker_utils.h" 18 #include "content/common/service_worker/service_worker_utils.h"
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 base::Bind(&ReceiveTestEventResult, &received_request_id2, 1355 base::Bind(&ReceiveTestEventResult, &received_request_id2,
1355 &received_data2, runner2->QuitClosure())); 1356 &received_data2, runner2->QuitClosure()));
1356 1357
1357 // Make sure events got dispatched in same order. 1358 // Make sure events got dispatched in same order.
1358 base::RunLoop().RunUntilIdle(); 1359 base::RunLoop().RunUntilIdle();
1359 ASSERT_EQ(2u, helper_->inner_ipc_sink()->message_count()); 1360 ASSERT_EQ(2u, helper_->inner_ipc_sink()->message_count());
1360 const IPC::Message* msg = helper_->inner_ipc_sink()->GetMessageAt(0); 1361 const IPC::Message* msg = helper_->inner_ipc_sink()->GetMessageAt(0);
1361 ASSERT_EQ(TestMsg_TestEvent::ID, msg->type()); 1362 ASSERT_EQ(TestMsg_TestEvent::ID, msg->type());
1362 TestMsg_TestEvent::Param params; 1363 TestMsg_TestEvent::Param params;
1363 TestMsg_TestEvent::Read(msg, &params); 1364 TestMsg_TestEvent::Read(msg, &params);
1364 EXPECT_EQ(request_id1, base::get<0>(params)); 1365 EXPECT_EQ(request_id1, std::get<0>(params));
1365 msg = helper_->inner_ipc_sink()->GetMessageAt(1); 1366 msg = helper_->inner_ipc_sink()->GetMessageAt(1);
1366 ASSERT_EQ(TestMsg_TestEvent::ID, msg->type()); 1367 ASSERT_EQ(TestMsg_TestEvent::ID, msg->type());
1367 TestMsg_TestEvent::Read(msg, &params); 1368 TestMsg_TestEvent::Read(msg, &params);
1368 EXPECT_EQ(request_id2, base::get<0>(params)); 1369 EXPECT_EQ(request_id2, std::get<0>(params));
1369 1370
1370 // Reply to second event. 1371 // Reply to second event.
1371 std::string reply2("foobar"); 1372 std::string reply2("foobar");
1372 helper_->SimulateSendEventResult( 1373 helper_->SimulateSendEventResult(
1373 version_->embedded_worker()->embedded_worker_id(), request_id2, reply2); 1374 version_->embedded_worker()->embedded_worker_id(), request_id2, reply2);
1374 runner2->Run(); 1375 runner2->Run();
1375 1376
1376 // Verify correct message callback got called with correct reply. 1377 // Verify correct message callback got called with correct reply.
1377 EXPECT_EQ(0, received_request_id1); 1378 EXPECT_EQ(0, received_request_id1);
1378 EXPECT_EQ(request_id2, received_request_id2); 1379 EXPECT_EQ(request_id2, received_request_id2);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 helper_->SimulateSendSimpleEventResult( 1463 helper_->SimulateSendSimpleEventResult(
1463 version_->embedded_worker()->embedded_worker_id(), request_id, 1464 version_->embedded_worker()->embedded_worker_id(), request_id,
1464 blink::WebServiceWorkerEventResultRejected); 1465 blink::WebServiceWorkerEventResultRejected);
1465 runner->Run(); 1466 runner->Run();
1466 1467
1467 // Verify callback was called with correct status. 1468 // Verify callback was called with correct status.
1468 EXPECT_EQ(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED, status); 1469 EXPECT_EQ(SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED, status);
1469 } 1470 }
1470 1471
1471 } // namespace content 1472 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_job_unittest.cc ('k') | content/browser/shared_worker/shared_worker_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698