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

Unified Diff: chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h

Issue 211030: [Mac] Expose AutocompleteEditViewMac to Cocoa code. (Closed)
Patch Set: Rohit's comments Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h
diff --git a/chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h b/chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae5cb1c22d2cbcf7476bf90f2f824f8e4649ca06
--- /dev/null
+++ b/chrome/browser/cocoa/autocomplete_text_field_unittest_helper.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_
+#define CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#import "chrome/browser/cocoa/autocomplete_text_field.h"
+
+@class AutocompleteTextFieldEditor;
+
+// Return the right field editor for AutocompleteTextField instance.
+
+@interface AutocompleteTextFieldWindowTestDelegate : NSObject {
+ scoped_nsobject<AutocompleteTextFieldEditor> editor_;
+}
+- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject;
+@end
+
+namespace {
+
+// Allow monitoring calls into AutocompleteTextField's observer.
+
+class AutocompleteTextFieldObserverMock : public AutocompleteTextFieldObserver {
+ public:
+ virtual void OnControlKeyChanged(bool pressed) {
+ on_control_key_changed_called_ = true;
+ on_control_key_changed_value_ = pressed;
+ }
+
+ virtual void OnPaste() {
+ on_paste_called_ = true;
+ }
+
+ void Reset() {
+ on_control_key_changed_called_ = false;
+ on_control_key_changed_value_ = false;
+ on_paste_called_ = false;
+ }
+
+ bool on_control_key_changed_called_;
+ bool on_control_key_changed_value_;
+ bool on_paste_called_;
+};
+
+} // namespace
+
+#endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_UNITTEST_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698