Index: chrome/test/data/webui/certificate_viewer_ui_test-inl.h |
diff --git a/chrome/test/data/webui/certificate_viewer_ui_test-inl.h b/chrome/test/data/webui/certificate_viewer_ui_test-inl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..22d8b6c9e66f391432b5256535666ac9580b8143 |
--- /dev/null |
+++ b/chrome/test/data/webui/certificate_viewer_ui_test-inl.h |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2011 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. |
+ |
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/browser_window.h" |
+// #include "chrome/browser/ui/webui/chrome_web_ui.h" |
+#include "chrome/browser/ui/webui/web_ui_browsertest.h" |
+#include "chrome/browser/certificate_viewer.h" |
+#include "chrome/common/url_constants.h" |
+#include "chrome/test/base/ui_test_utils.h" |
+#include "chrome/test/base/test_html_dialog_observer.h" |
+#include "content/browser/renderer_host/render_view_host.h" |
+#include "content/browser/tab_contents/tab_contents.h" |
+#include "content/browser/webui/web_ui.h" |
+#include "net/base/test_certificate_data.h" |
+#include "net/base/x509_certificate.h" |
+ |
+// Test framework for chrome/test/data/webui/certificate_viewer_dialog_test.js. |
+class CertificateViewerUITest : public WebUIBrowserTest { |
+ public: |
+ CertificateViewerUITest(); |
+ virtual ~CertificateViewerUITest(); |
+ |
+ virtual void SetUpOnMainThread() { |
Sheridan Rawlins
2011/09/20 16:04:19
private? (I think since the superclass is public,
flackr
2011/09/20 18:24:52
Done.
|
+ // Need to enable more WebUI when runtime flag is in use. |
+ // ChromeWebUI::SetMoreWebUI(true); |
+ |
+ scoped_refptr<net::X509Certificate> google_cert( |
+ net::X509Certificate::CreateFromBytes( |
+ reinterpret_cast<const char*>(google_der), sizeof(google_der))); |
+ |
+ ASSERT_TRUE(browser()); |
+ ASSERT_TRUE(browser()->window()); |
+ |
+ TestHtmlDialogObserver dialog_observer; |
+ ShowCertificateViewer(browser()->window()->GetNativeHandle(), google_cert); |
+ WebUI* webui = dialog_observer.GetWebUI(); |
+ webui->tab_contents()->render_view_host()->SetWebUIProperty( |
+ "expectedUrl", chrome::kChromeUICertificateViewerURL); |
+ SetWebUIInstance(webui); |
+ WebUIBrowserTest::SetUpOnMainThread(); |
+ } |
+}; |