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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 12620003: Fix copy/cut from menu when omnibox is focused (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h"
12 #include "chrome/browser/autocomplete/autocomplete_match.h" 13 #include "chrome/browser/autocomplete/autocomplete_match.h"
13 #include "chrome/browser/autocomplete/history_quick_provider.h" 14 #include "chrome/browser/autocomplete/history_quick_provider.h"
14 #include "chrome/browser/bookmarks/bookmark_model.h" 15 #include "chrome/browser/bookmarks/bookmark_model.h"
15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
16 #include "chrome/browser/bookmarks/bookmark_utils.h" 17 #include "chrome/browser/bookmarks/bookmark_utils.h"
17 #include "chrome/browser/history/history_service.h" 18 #include "chrome/browser/history/history_service.h"
18 #include "chrome/browser/history/history_service_factory.h" 19 #include "chrome/browser/history/history_service_factory.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/search_engines/template_url.h" 21 #include "chrome/browser/search_engines/template_url.h"
21 #include "chrome/browser/search_engines/template_url_service.h" 22 #include "chrome/browser/search_engines/template_url_service.h"
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 // Location bar must have focus to receive Ctrl-C. 1683 // Location bar must have focus to receive Ctrl-C.
1683 chrome::FocusLocationBar(browser()); 1684 chrome::FocusLocationBar(browser());
1684 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); 1685 ASSERT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX));
1685 1686
1686 // Select full URL and copy it to clipboard. General text and html should 1687 // Select full URL and copy it to clipboard. General text and html should
1687 // be available. 1688 // be available.
1688 omnibox_view->SelectAll(true); 1689 omnibox_view->SelectAll(true);
1689 EXPECT_TRUE(omnibox_view->IsSelectAll()); 1690 EXPECT_TRUE(omnibox_view->IsSelectAll());
1690 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); 1691 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
1691 clipboard->Clear(ui::Clipboard::BUFFER_STANDARD); 1692 clipboard->Clear(ui::Clipboard::BUFFER_STANDARD);
1692 ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_C, kCtrlOrCmdMask)); 1693 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_COPY));
1693 EXPECT_TRUE(clipboard->IsFormatAvailable( 1694 EXPECT_TRUE(clipboard->IsFormatAvailable(
1694 ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD)); 1695 ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD));
1695 1696
1696 // The Mac is the only platform which doesn't write html. 1697 // The Mac is the only platform which doesn't write html.
1697 #if !defined(OS_MACOSX) 1698 #if !defined(OS_MACOSX)
1698 EXPECT_TRUE(clipboard->IsFormatAvailable( 1699 EXPECT_TRUE(clipboard->IsFormatAvailable(
1699 ui::Clipboard::GetHtmlFormatType(), ui::Clipboard::BUFFER_STANDARD)); 1700 ui::Clipboard::GetHtmlFormatType(), ui::Clipboard::BUFFER_STANDARD));
1700 #endif 1701 #endif
1701 1702
1702 // These platforms should read bookmark format. 1703 // These platforms should read bookmark format.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 // BrowserWindowController depends on the auto release pool being recycled 1810 // BrowserWindowController depends on the auto release pool being recycled
1810 // in the message loop to delete itself, which frees the Browser object 1811 // in the message loop to delete itself, which frees the Browser object
1811 // which fires this event. 1812 // which fires this event.
1812 AutoreleasePool()->Recycle(); 1813 AutoreleasePool()->Recycle();
1813 #endif 1814 #endif
1814 1815
1815 signal.Wait(); 1816 signal.Wait();
1816 EXPECT_FALSE(clipboard->IsFormatAvailable( 1817 EXPECT_FALSE(clipboard->IsFormatAvailable(
1817 ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD)); 1818 ui::Clipboard::GetPlainTextFormatType(), ui::Clipboard::BUFFER_STANDARD));
1818 } 1819 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698