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

Side by Side Diff: chrome/browser/extensions/extension_menu_manager_unittest.cc

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 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
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 <vector> 5 #include <vector>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/extensions/extension_event_router.h" 13 #include "chrome/browser/extensions/extension_event_router.h"
14 #include "chrome/browser/extensions/extension_menu_manager.h" 14 #include "chrome/browser/extensions/extension_menu_manager.h"
15 #include "chrome/browser/extensions/test_extension_prefs.h" 15 #include "chrome/browser/extensions/test_extension_prefs.h"
16 #include "chrome/common/chrome_notification_types.h" 16 #include "chrome/common/chrome_notification_types.h"
17 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
18 #include "chrome/common/extensions/extension.h" 18 #include "chrome/common/extensions/extension.h"
19 #include "chrome/common/extensions/extension_constants.h" 19 #include "chrome/common/extensions/extension_constants.h"
20 #include "chrome/test/base/testing_profile.h" 20 #include "chrome/test/base/testing_profile.h"
21 #include "chrome/test/testing_browser_process_test.h"
21 #include "content/browser/browser_thread.h" 22 #include "content/browser/browser_thread.h"
22 #include "content/common/notification_service.h" 23 #include "content/common/notification_service.h"
23 #include "testing/gmock/include/gmock/gmock.h" 24 #include "testing/gmock/include/gmock/gmock.h"
24 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
25 #include "webkit/glue/context_menu.h" 26 #include "webkit/glue/context_menu.h"
26 27
27 using testing::_; 28 using testing::_;
28 using testing::AtLeast; 29 using testing::AtLeast;
29 using testing::Return; 30 using testing::Return;
30 using testing::SaveArg; 31 using testing::SaveArg;
31 32
32 // Base class for tests. 33 // Base class for tests.
33 class ExtensionMenuManagerTest : public testing::Test { 34 class ExtensionMenuManagerTest : public TestingBrowserProcessTest {
34 public: 35 public:
35 ExtensionMenuManagerTest() 36 ExtensionMenuManagerTest()
36 : ui_thread_(BrowserThread::UI, &message_loop_), 37 : ui_thread_(BrowserThread::UI, &message_loop_),
37 file_thread_(BrowserThread::FILE, &message_loop_), 38 file_thread_(BrowserThread::FILE, &message_loop_),
38 next_id_(1) { 39 next_id_(1) {
39 } 40 }
40 41
41 // Returns a test item. 42 // Returns a test item.
42 ExtensionMenuItem* CreateTestItem(Extension* extension) { 43 ExtensionMenuItem* CreateTestItem(Extension* extension) {
43 ExtensionMenuItem::Type type = ExtensionMenuItem::NORMAL; 44 ExtensionMenuItem::Type type = ExtensionMenuItem::NORMAL;
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 ASSERT_EQ(params.page_url.spec(), tmp); 482 ASSERT_EQ(params.page_url.spec(), tmp);
482 483
483 string16 tmp16; 484 string16 tmp16;
484 ASSERT_TRUE(info->GetString("selectionText", &tmp16)); 485 ASSERT_TRUE(info->GetString("selectionText", &tmp16));
485 ASSERT_EQ(params.selection_text, tmp16); 486 ASSERT_EQ(params.selection_text, tmp16);
486 487
487 bool bool_tmp = true; 488 bool bool_tmp = true;
488 ASSERT_TRUE(info->GetBoolean("editable", &bool_tmp)); 489 ASSERT_TRUE(info->GetBoolean("editable", &bool_tmp));
489 ASSERT_EQ(params.is_editable, bool_tmp); 490 ASSERT_EQ(params.is_editable, bool_tmp);
490 } 491 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_icon_manager_unittest.cc ('k') | chrome/browser/extensions/extension_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698