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

Unified Diff: chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.mm

Issue 2724603002: MacViews: Enable AppleScript support. (Closed)
Patch Set: MacViews: Enable AppleScript support. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.mm
diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.mm b/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.mm
similarity index 81%
rename from chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.mm
rename to chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.mm
index 4f2fc760fc67a0b4d7ef8e180d1c4b0f00d5e5bc..975601d5e43c0c09047a472dca529695959461ed 100644
--- a/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.mm
+++ b/chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.mm
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h"
+#import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_test.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
@@ -12,17 +13,6 @@
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
-@implementation FakeAppDelegate
-
-@synthesize test = test_;
-
-- (Profile*)lastProfile {
- if (!test_)
- return NULL;
- return test_->profile();
-}
-@end
-
// Represents the current fake command that is executing.
static FakeScriptCommand* kFakeCurrentCommand;
@@ -56,17 +46,12 @@ BookmarkAppleScriptTest::BookmarkAppleScriptTest() {
}
BookmarkAppleScriptTest::~BookmarkAppleScriptTest() {
- [NSApp setDelegate:nil];
}
-void BookmarkAppleScriptTest::SetUp() {
- CocoaProfileTest::SetUp();
+void BookmarkAppleScriptTest::SetUpOnMainThread() {
+ InProcessBrowserTest::SetUpOnMainThread();
ASSERT_TRUE(profile());
- appDelegate_.reset([[FakeAppDelegate alloc] init]);
- [appDelegate_.get() setTest:this];
- DCHECK([NSApp delegate] == nil);
- [NSApp setDelegate:appDelegate_];
BookmarkModel* model = BookmarkModelFactory::GetForBrowserContext(profile());
const BookmarkNode* root = model->bookmark_bar_node();
const std::string modelString("a f1:[ b d c ] d f2:[ e f g ] h ");
@@ -74,3 +59,7 @@ void BookmarkAppleScriptTest::SetUp() {
bookmarkBar_.reset([[BookmarkFolderAppleScript alloc]
initWithBookmarkNode:model->bookmark_bar_node()]);
}
+
+Profile* BookmarkAppleScriptTest::profile() const {
+ return browser()->profile();
+}

Powered by Google App Engine
This is Rietveld 408576698