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

Side by Side Diff: chrome/test/data/webui/certificate_viewer_dialog_test.js

Issue 10407051: Revert r137984 "Fix for broken CertificateViewerUITest.testDetails." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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
« no previous file with comments | « chrome/browser/resources/certificate_viewer.js ('k') | no next file » | 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 /** 5 /**
6 * Test fixture for generated tests. 6 * Test fixture for generated tests.
7 * @extends {testing.Test} 7 * @extends {testing.Test}
8 */ 8 */
9 function CertificateViewerUITest() {} 9 function CertificateViewerUITest() {};
10 10
11 CertificateViewerUITest.prototype = { 11 CertificateViewerUITest.prototype = {
12 __proto__: testing.Test.prototype, 12 __proto__: testing.Test.prototype,
13 13
14 /** 14 /**
15 * Define the C++ fixture class and include it. 15 * Define the C++ fixture class and include it.
16 * @type {?string} 16 * @type {?string}
17 * @override 17 * @override
18 */ 18 */
19 typedefCppFixture: 'CertificateViewerUITest', 19 typedefCppFixture: 'CertificateViewerUITest',
20 20
21 /** 21 /**
22 * Show the certificate viewer dialog. 22 * Show the certificate viewer dialog.
23 */ 23 */
24 testGenPreamble: function() { 24 testGenPreamble: function() {
25 GEN('ShowCertificateViewer();'); 25 GEN('ShowCertificateViewer();');
26 }, 26 },
27 27
28 }; 28 };
29 29
30 /** 30 /**
31 * Test fixture for asynchronous tests. 31 * Test fixture for asynchronous tests.
32 * @extends {CertificateViewerUITest} 32 * @extends {CertificateViewerUITest}
33 */ 33 */
34 function CertificateViewerUITestAsync() {} 34 function CertificateViewerUITestAsync() {};
35 35
36 CertificateViewerUITestAsync.prototype = { 36 CertificateViewerUITestAsync.prototype = {
37 __proto__: CertificateViewerUITest.prototype, 37 __proto__: CertificateViewerUITest.prototype,
38 38
39 /** @inheritDoc */ 39 /** @inheritDoc */
40 isAsync: true, 40 isAsync: true,
41 }; 41 };
42 42
43 // Include the bulk of c++ code. 43 // Include the bulk of c++ code.
44 // Certificate viewer UI tests are disabled on platforms with native certificate 44 // Certificate viewer UI tests are disabled on platforms with native certificate
45 // viewers. 45 // viewers.
46 GEN('#include "chrome/test/data/webui/certificate_viewer_ui_test-inl.h"'); 46 GEN('#include "chrome/test/data/webui/certificate_viewer_ui_test-inl.h"');
47 GEN(''); 47 GEN('')
48 48
49 // Constructors and destructors must be provided in .cc to prevent clang errors. 49 // Constructors and destructors must be provided in .cc to prevent clang errors.
50 GEN('CertificateViewerUITest::CertificateViewerUITest() {}'); 50 GEN('CertificateViewerUITest::CertificateViewerUITest() {}');
51 GEN('CertificateViewerUITest::~CertificateViewerUITest() {}'); 51 GEN('CertificateViewerUITest::~CertificateViewerUITest() {}');
52 52
53 /** 53 /**
54 * Tests that the dialog opened to the correct URL. 54 * Tests that the dialog opened to the correct URL.
55 */ 55 */
56 TEST_F('CertificateViewerUITest', 'testDialogURL', function() { 56 TEST_F('CertificateViewerUITest', 'testDialogURL', function() {
57 assertEquals(chrome.expectedUrl, window.location.href); 57 assertEquals(chrome.expectedUrl, window.location.href);
58 }); 58 });
59 59
60 /** 60 /**
61 * Tests for the correct common name in the test certificate. 61 * Tests for the correct common name in the test certificate.
62 */ 62 */
63 TEST_F('CertificateViewerUITest', 'testCN', function() { 63 TEST_F('CertificateViewerUITest', 'testCN', function() {
64 assertEquals('www.google.com', $('issued-cn').textContent); 64 assertEquals('www.google.com', $('issued-cn').textContent);
65 }); 65 });
66 66
67 /** 67 /**
68 * Test the details pane of the certificate viewer. This verifies that a 68 * Test the details pane of the certificate viewer. This verifies that a
69 * certificate in the chain can be selected to view the fields. And that fields 69 * certificate in the chain can be selected to view the fields. And that fields
70 * can be selected to view their values. 70 * can be selected to view their values.
71 * TODO(flackr,kgr): Re-enable this (http://crbug.com/127732).
71 */ 72 */
72 TEST_F('CertificateViewerUITestAsync', 'testDetails', function() { 73 TEST_F('CertificateViewerUITestAsync', 'DISABLED_testDetails', function() {
73 var certHierarchy = $('hierarchy'); 74 var certHierarchy = $('hierarchy');
74 var certFields = $('cert-fields'); 75 var certFields = $('cert-fields');
75 var certFieldVal = $('cert-field-value'); 76 var certFieldVal = $('cert-field-value');
76 77
77 // There must be at least one certificate in the hierarchy. 78 // There must be at least one certificate in the hierarchy.
78 assertLT(0, certHierarchy.childNodes.length); 79 assertLT(0, certHierarchy.childNodes.length);
79 80
80 // Select the second tab, causing its data to be loaded if needed.
81 $('tabbox').selectedIndex = 1;
82
83 // Select the first certificate on the chain and ensure the details show up. 81 // Select the first certificate on the chain and ensure the details show up.
84 // Override the receive certificate function to catch when fields are 82 // Override the receive certificate function to catch when fields are
85 // loaded. 83 // loaded.
86 certHierarchy.selectedItem = null;
87 var getCertificateFields = cert_viewer.getCertificateFields; 84 var getCertificateFields = cert_viewer.getCertificateFields;
88 cert_viewer.getCertificateFields = this.continueTest(WhenTestDone.ALWAYS, 85 cert_viewer.getCertificateFields = this.continueTest(WhenTestDone.ALWAYS,
89 function(certFieldDetails) { 86 function(certFieldDetails) {
90 getCertificateFields(certFieldDetails); 87 getCertificateFields(certFieldDetails);
91 cert_viewer.getCertificateFields = getCertificateFields; 88 cert_viewer.getCertificateFields = getCertificateFields;
92 assertLT(0, certFields.childNodes.length); 89 assertLT(0, certFields.childNodes.length);
93 90
94 // Test that a field can be selected to see the details for that field. 91 // Test that a field can be selected to see the details for that field.
95 var item = getElementWithValue(certFields); 92 var item = getElementWithValue(certFields);
96 assertNotEquals(null, item); 93 assertNotEquals(null, item);
(...skipping 18 matching lines...) Expand all
115 function getElementWithValue(tree) { 112 function getElementWithValue(tree) {
116 for (var i = 0; i < tree.childNodes.length; i++) { 113 for (var i = 0; i < tree.childNodes.length; i++) {
117 var element = tree.childNodes[i]; 114 var element = tree.childNodes[i];
118 if (element.detail && element.detail.payload && element.detail.payload.val) 115 if (element.detail && element.detail.payload && element.detail.payload.val)
119 return element; 116 return element;
120 if (element = getElementWithValue(element)) 117 if (element = getElementWithValue(element))
121 return element; 118 return element;
122 } 119 }
123 return null; 120 return null;
124 } 121 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/certificate_viewer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698