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

Side by Side Diff: content/renderer/render_thread_impl_browsertest.cc

Issue 1532053002: use variadic macros/templates in IPC message implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/discardable_memory.h" 8 #include "base/memory/discardable_memory.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "components/scheduler/renderer/renderer_scheduler.h" 12 #include "components/scheduler/renderer/renderer_scheduler.h"
13 #include "content/app/mojo/mojo_init.h" 13 #include "content/app/mojo/mojo_init.h"
14 #include "content/common/in_process_child_thread_params.h" 14 #include "content/common/in_process_child_thread_params.h"
15 #include "content/common/resource_messages.h" 15 #include "content/common/resource_messages.h"
16 #include "content/common/websocket_messages.h" 16 #include "content/common/websocket_messages.h"
17 #include "content/public/browser/content_browser_client.h" 17 #include "content/public/browser/content_browser_client.h"
18 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
19 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
20 #include "content/public/renderer/content_renderer_client.h" 20 #include "content/public/renderer/content_renderer_client.h"
21 #include "content/renderer/render_process_impl.h" 21 #include "content/renderer/render_process_impl.h"
22 #include "content/renderer/render_thread_impl.h" 22 #include "content/renderer/render_thread_impl.h"
23 #include "content/test/mock_render_process.h" 23 #include "content/test/mock_render_process.h"
24 #include "content/test/render_thread_impl_browser_test_ipc_helper.h" 24 #include "content/test/render_thread_impl_browser_test_ipc_helper.h"
25 #include "gpu/GLES2/gl2extchromium.h" 25 #include "gpu/GLES2/gl2extchromium.h"
26 #include "testing/gtest/include/gtest/gtest.h" 26 #include "testing/gtest/include/gtest/gtest.h"
27 27
28 // IPC messages for testing ---------------------------------------------------- 28 // IPC messages for testing ----------------------------------------------------
29 29
30 // TODO(mdempsky): Fix properly.
danakj 2015/12/19 00:15:05 Can you leave more context, what is properly?
mdempsky 2015/12/19 02:14:48 "Properly" here is creating browsertest_messages.h
31 #undef IPC_IPC_MESSAGE_MACROS_H_
32 #undef IPC_MESSAGE_EXTRA
30 #define IPC_MESSAGE_IMPL 33 #define IPC_MESSAGE_IMPL
31 #include "ipc/ipc_message_macros.h" 34 #include "ipc/ipc_message_macros.h"
35 #include "ipc/ipc_message_templates_impl.h"
32 36
33 #undef IPC_MESSAGE_START 37 #undef IPC_MESSAGE_START
34 #define IPC_MESSAGE_START TestMsgStart 38 #define IPC_MESSAGE_START TestMsgStart
35 IPC_MESSAGE_CONTROL0(TestMsg_QuitRunLoop) 39 IPC_MESSAGE_CONTROL0(TestMsg_QuitRunLoop)
36 40
37 // ----------------------------------------------------------------------------- 41 // -----------------------------------------------------------------------------
38 42
39 // These tests leak memory, this macro disables the test when under the 43 // These tests leak memory, this macro disables the test when under the
40 // LeakSanitizer. 44 // LeakSanitizer.
41 #ifdef LEAK_SANITIZER 45 #ifdef LEAK_SANITIZER
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); 236 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, ""));
233 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); 237 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop());
234 238
235 test_helper_->GetMessageLoop()->Run(); 239 test_helper_->GetMessageLoop()->Run();
236 240
237 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); 241 EXPECT_EQ(0, test_task_counter_->NumTasksPosted());
238 } 242 }
239 243
240 } // namespace 244 } // namespace
241 } // namespace content 245 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698