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

Side by Side Diff: chrome/browser/translate/translate_manager_unittest.cc

Issue 6290008: Move the TestSink for doing IPC tests from chrome/common into IPC and create ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « chrome/browser/renderer_host/mock_render_process_host.h ('k') | chrome/chrome_tests.gypi » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/test/test_render_view_host.h" 5 #include "chrome/browser/renderer_host/test/test_render_view_host.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/prefs/pref_change_registrar.h" 10 #include "chrome/browser/prefs/pref_change_registrar.h"
11 #include "chrome/browser/renderer_host/mock_render_process_host.h" 11 #include "chrome/browser/renderer_host/mock_render_process_host.h"
12 #include "chrome/browser/tab_contents/navigation_controller.h" 12 #include "chrome/browser/tab_contents/navigation_controller.h"
13 #include "chrome/browser/tab_contents/render_view_context_menu.h" 13 #include "chrome/browser/tab_contents/render_view_context_menu.h"
14 #include "chrome/browser/tab_contents/test_tab_contents.h" 14 #include "chrome/browser/tab_contents/test_tab_contents.h"
15 #include "chrome/browser/translate/translate_infobar_delegate.h" 15 #include "chrome/browser/translate/translate_infobar_delegate.h"
16 #include "chrome/browser/translate/translate_manager.h" 16 #include "chrome/browser/translate/translate_manager.h"
17 #include "chrome/browser/translate/translate_prefs.h" 17 #include "chrome/browser/translate/translate_prefs.h"
18 #include "chrome/common/ipc_test_sink.h"
19 #include "chrome/common/notification_details.h" 18 #include "chrome/common/notification_details.h"
20 #include "chrome/common/notification_observer_mock.h" 19 #include "chrome/common/notification_observer_mock.h"
21 #include "chrome/common/notification_registrar.h" 20 #include "chrome/common/notification_registrar.h"
22 #include "chrome/common/notification_type.h" 21 #include "chrome/common/notification_type.h"
23 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
24 #include "chrome/common/render_messages.h" 23 #include "chrome/common/render_messages.h"
25 #include "chrome/common/net/test_url_fetcher_factory.h" 24 #include "chrome/common/net/test_url_fetcher_factory.h"
26 #include "chrome/test/testing_browser_process.h" 25 #include "chrome/test/testing_browser_process.h"
27 #include "chrome/test/testing_profile.h" 26 #include "chrome/test/testing_profile.h"
28 #include "grit/generated_resources.h" 27 #include "grit/generated_resources.h"
28 #include "ipc/ipc_test_sink.h"
29 #include "testing/gmock/include/gmock/gmock.h" 29 #include "testing/gmock/include/gmock/gmock.h"
30 #include "third_party/cld/languages/public/languages.h" 30 #include "third_party/cld/languages/public/languages.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
32 32
33 using testing::_; 33 using testing::_;
34 using testing::Pointee; 34 using testing::Pointee;
35 using testing::Property; 35 using testing::Property;
36 using WebKit::WebContextMenuData; 36 using WebKit::WebContextMenuData;
37 37
38 class TranslateManagerTest : public RenderViewHostTestHarness, 38 class TranslateManagerTest : public RenderViewHostTestHarness,
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 NULL); 1222 NULL);
1223 // Now simulate the URL fetch. 1223 // Now simulate the URL fetch.
1224 SimulateURLFetch(true); 1224 SimulateURLFetch(true);
1225 // Now the message should have been sent. 1225 // Now the message should have been sent.
1226 int page_id = 0; 1226 int page_id = 0;
1227 std::string original_lang, target_lang; 1227 std::string original_lang, target_lang;
1228 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); 1228 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang));
1229 EXPECT_EQ("es", original_lang); 1229 EXPECT_EQ("es", original_lang);
1230 EXPECT_EQ("en", target_lang); 1230 EXPECT_EQ("en", target_lang);
1231 } 1231 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/mock_render_process_host.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698