| OLD | NEW |
| 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 "chrome/browser/renderer_context_menu/spelling_menu_observer.h" | 5 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/prefs/pref_service.h" | |
| 13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 15 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 14 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 16 #include "chrome/browser/spellchecker/spelling_service_client.h" | 15 #include "chrome/browser/spellchecker/spelling_service_client.h" |
| 17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 19 #include "components/prefs/pref_service.h" |
| 20 #include "components/renderer_context_menu/render_view_context_menu_observer.h" | 20 #include "components/renderer_context_menu/render_view_context_menu_observer.h" |
| 21 | 21 |
| 22 using content::RenderViewHost; | 22 using content::RenderViewHost; |
| 23 using content::WebContents; | 23 using content::WebContents; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // A mock context menu used in this test. This class overrides virtual methods | 27 // A mock context menu used in this test. This class overrides virtual methods |
| 28 // derived from the RenderViewContextMenuProxy class to monitor calls from the | 28 // derived from the RenderViewContextMenuProxy class to monitor calls from the |
| 29 // SpellingMenuObserver class. | 29 // SpellingMenuObserver class. |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 ForceSuggestMode(); | 449 ForceSuggestMode(); |
| 450 InitMenu("asdfkj", NULL); | 450 InitMenu("asdfkj", NULL); |
| 451 | 451 |
| 452 // Should have at least 2 entries. Separator, suggestion. | 452 // Should have at least 2 entries. Separator, suggestion. |
| 453 EXPECT_LT(2U, menu()->GetMenuSize()); | 453 EXPECT_LT(2U, menu()->GetMenuSize()); |
| 454 menu()->GetMenuItem(0, &item); | 454 menu()->GetMenuItem(0, &item); |
| 455 EXPECT_EQ(-1, item.command_id); | 455 EXPECT_EQ(-1, item.command_id); |
| 456 menu()->GetMenuItem(1, &item); | 456 menu()->GetMenuItem(1, &item); |
| 457 EXPECT_EQ(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, item.command_id); | 457 EXPECT_EQ(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, item.command_id); |
| 458 } | 458 } |
| OLD | NEW |