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

Side by Side Diff: chrome/browser/ui/webui/certificate_viewer_ui_browsertest.cc

Issue 7861024: Adds testing infrastructure to web_ui_browsertest to support testing HtmlDialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/file_path.h"
6 #include "base/time.h"
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_window.h"
9 // #include "chrome/browser/ui/webui/chrome_web_ui.h"
flackr 2011/09/09 15:11:04 This will be uncommented before submission. I am w
10 #include "chrome/browser/ui/webui/web_ui_browsertest.h"
11 #include "chrome/browser/certificate_viewer.h"
12 #include "chrome/common/url_constants.h"
13 #include "chrome/test/base/ui_test_utils.h"
14 #include "net/base/test_certificate_data.h"
15 #include "net/base/x509_certificate.h"
16 #include <iostream>
Paweł Hajdan Jr. 2011/09/09 22:13:55 Do not #include <iostream>. This results in some s
flackr 2011/09/15 18:41:52 Oops, was using some cerr statements to help debug
17
18 class CertificateViewerUITest : public WebUIBrowserTest {
19 public:
20 virtual ~CertificateViewerUITest() {}
21
22 virtual void SetUpOnMainThread() {
23 // Need to enable more WebUI when runtime flag is in use.
24 // ChromeWebUI::SetMoreWebUI(true);
flackr 2011/09/09 15:11:04 This will be uncommented before submission. I am w
25
26 scoped_refptr<net::X509Certificate> google_cert(
27 net::X509Certificate::CreateFromBytes(
28 reinterpret_cast<const char*>(google_der), sizeof(google_der)));
29
30 DCHECK(browser());
31 DCHECK(browser()->window());
32
33 ObserveNextHtmlDialog();
34 ShowCertificateViewer(browser()->window()->GetNativeHandle(), google_cert);
35 WaitForHtmlDialogLoad();
36 AddLibrary(FilePath(FILE_PATH_LITERAL(
37 "certificate_viewer_dialog_test.js")));
38 WebUIBrowserTest::SetUpOnMainThread();
39
40 }
41 };
42
43 WEB_UI_UNITTEST_F1(CertificateViewerUITest, testDialogURL, new StringValue(
44 chrome::kChromeUICertificateViewerURL));
45 WEB_UI_UNITTEST_F(CertificateViewerUITest, testCN);
46 WEB_UI_ASYNC_UNITTEST_F(CertificateViewerUITest, testDetails);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/html_dialog_ui.cc » ('j') | chrome/browser/ui/webui/web_ui_browsertest.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698