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

Side by Side Diff: chrome/browser/bookmarks/bookmark_manager_extension_apitest.cc

Issue 10966025: Change bookmarkManager API from experimental to private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bookmarkManager->bookmarkManagerPrivate Created 8 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" 7 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h"
8 #include "chrome/browser/bookmarks/bookmark_model.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #include "chrome/browser/extensions/extension_apitest.h" 10 #include "chrome/browser/extensions/extension_apitest.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "chrome/test/base/ui_test_utils.h" 16 #include "chrome/test/base/ui_test_utils.h"
17 17
18 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BookmarkManager) { 18 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BookmarkManager) {
19 CommandLine::ForCurrentProcess()->AppendSwitch( 19 CommandLine::ForCurrentProcess()->AppendSwitch(
20 switches::kEnableExperimentalExtensionApis); 20 switches::kEnableExperimentalExtensionApis);
21 21
22 ASSERT_TRUE(RunExtensionTest("bookmark_manager/standard")) << message_; 22 ASSERT_TRUE(RunComponentExtensionTest("bookmark_manager/standard"))
23 << message_;
23 } 24 }
24 25
25 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BookmarkManagerEditDisabled) { 26 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BookmarkManagerEditDisabled) {
26 CommandLine::ForCurrentProcess()->AppendSwitch( 27 CommandLine::ForCurrentProcess()->AppendSwitch(
27 switches::kEnableExperimentalExtensionApis); 28 switches::kEnableExperimentalExtensionApis);
28 29
29 Profile* profile = browser()->profile(); 30 Profile* profile = browser()->profile();
30 31
31 // Provide some testing data here, since bookmark editing will be disabled 32 // Provide some testing data here, since bookmark editing will be disabled
32 // within the extension. 33 // within the extension.
33 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); 34 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile);
34 ui_test_utils::WaitForBookmarkModelToLoad(model); 35 ui_test_utils::WaitForBookmarkModelToLoad(model);
35 const BookmarkNode* bar = model->bookmark_bar_node(); 36 const BookmarkNode* bar = model->bookmark_bar_node();
36 const BookmarkNode* folder = model->AddFolder(bar, 0, ASCIIToUTF16("Folder")); 37 const BookmarkNode* folder = model->AddFolder(bar, 0, ASCIIToUTF16("Folder"));
37 model->AddURL(bar, 1, ASCIIToUTF16("AAA"), GURL("http://aaa.example.com")); 38 model->AddURL(bar, 1, ASCIIToUTF16("AAA"), GURL("http://aaa.example.com"));
38 model->AddURL(folder, 0, ASCIIToUTF16("BBB"), GURL("http://bbb.example.com")); 39 model->AddURL(folder, 0, ASCIIToUTF16("BBB"), GURL("http://bbb.example.com"));
39 40
40 profile->GetPrefs()->SetBoolean(prefs::kEditBookmarksEnabled, false); 41 profile->GetPrefs()->SetBoolean(prefs::kEditBookmarksEnabled, false);
41 42
42 ASSERT_TRUE(RunExtensionTest("bookmark_manager/edit_disabled")) << message_; 43 ASSERT_TRUE(RunComponentExtensionTest("bookmark_manager/edit_disabled"))
44 << message_;
43 } 45 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_manager_extension_api.h ('k') | chrome/browser/resources/bookmark_manager/js/bmm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698