OLD | NEW |
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 test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['net_internals_test.js']); | 6 GEN_INCLUDE(['net_internals_test.js']); |
7 | 7 |
8 // Anonymous namespace | 8 // Anonymous namespace |
9 (function() { | 9 (function() { |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 /** | 109 /** |
110 * Checks successful results. | 110 * Checks successful results. |
111 * @param {object} result Results from the query. | 111 * @param {object} result Results from the query. |
112 */ | 112 */ |
113 checkSuccess_: function(result) { | 113 checkSuccess_: function(result) { |
114 expectEquals(QueryResultType.SUCCESS, this.queryResultType_); | 114 expectEquals(QueryResultType.SUCCESS, this.queryResultType_); |
115 expectEquals(this.subdomains_, result.subdomains); | 115 expectEquals(this.subdomains_, result.subdomains); |
116 | 116 |
117 // |public_key_hashes| is an old synonym for what is now | 117 // |public_key_hashes| is an old synonym for what is now |
118 // |preloaded_spki_hashes|. Look for both, and also for | 118 // |preloaded_spki_hashes|, which in turn is a legacy synonym for |
| 119 // |static_spki_hashes|. Look for all three, and also for |
119 // |dynamic_spki_hashes|. | 120 // |dynamic_spki_hashes|. |
120 if (typeof result.public_key_hashes === 'undefined') | 121 if (typeof result.public_key_hashes === 'undefined') |
121 result.public_key_hashes = ''; | 122 result.public_key_hashes = ''; |
122 if (typeof result.preloaded_spki_hashes === 'undefined') | 123 if (typeof result.preloaded_spki_hashes === 'undefined') |
123 result.preloaded_spki_hashes = ''; | 124 result.preloaded_spki_hashes = ''; |
| 125 if (typeof result.static_spki_hashes === 'undefined') |
| 126 result.static_spki_hashes = ''; |
124 if (typeof result.dynamic_spki_hashes === 'undefined') | 127 if (typeof result.dynamic_spki_hashes === 'undefined') |
125 result.dynamic_spki_hashes = ''; | 128 result.dynamic_spki_hashes = ''; |
126 | 129 |
127 var hashes = []; | 130 var hashes = []; |
128 if (result.public_key_hashes) | 131 if (result.public_key_hashes) |
129 hashes.push(result.public_key_hashes); | 132 hashes.push(result.public_key_hashes); |
130 if (result.preloaded_spki_hashes) | 133 if (result.preloaded_spki_hashes) |
131 hashes.push(result.preloaded_spki_hashes); | 134 hashes.push(result.preloaded_spki_hashes); |
| 135 if (result.static_spki_hashes) |
| 136 hashes.push(result.static_spki_hashes); |
132 if (result.dynamic_spki_hashes) | 137 if (result.dynamic_spki_hashes) |
133 hashes.push(result.dynamic_spki_hashes); | 138 hashes.push(result.dynamic_spki_hashes); |
134 | 139 |
135 expectEquals(this.publicKeyHashes_, hashes.join(",")); | 140 expectEquals(this.publicKeyHashes_, hashes.join(',')); |
136 | 141 |
137 // Verify that the domain appears somewhere in the displayed text. | 142 // Verify that the domain appears somewhere in the displayed text. |
138 outputText = $(HSTSView.QUERY_OUTPUT_DIV_ID).innerText; | 143 outputText = $(HSTSView.QUERY_OUTPUT_DIV_ID).innerText; |
139 expectLE(0, outputText.search(this.domain_)); | 144 expectLE(0, outputText.search(this.domain_)); |
140 } | 145 } |
141 }; | 146 }; |
142 | 147 |
143 /** | 148 /** |
144 * A Task to try and add an HSTS domain via the HTML form. The task will wait | 149 * A Task to try and add an HSTS domain via the HTML form. The task will wait |
145 * until the results from the automatically sent query have been received, and | 150 * until the results from the automatically sent query have been received, and |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 QueryResultType.SUCCESS)); | 351 QueryResultType.SUCCESS)); |
347 taskQueue.addTask(new DeleteTask('somewhere.com', QueryResultType.NOT_FOUND)); | 352 taskQueue.addTask(new DeleteTask('somewhere.com', QueryResultType.NOT_FOUND)); |
348 taskQueue.addTask(new QueryTask('somewhereelse.com', true, '', | 353 taskQueue.addTask(new QueryTask('somewhereelse.com', true, '', |
349 QueryResultType.SUCCESS)); | 354 QueryResultType.SUCCESS)); |
350 taskQueue.addTask(new DeleteTask('somewhereelse.com', | 355 taskQueue.addTask(new DeleteTask('somewhereelse.com', |
351 QueryResultType.NOT_FOUND)); | 356 QueryResultType.NOT_FOUND)); |
352 taskQueue.run(true); | 357 taskQueue.run(true); |
353 }); | 358 }); |
354 | 359 |
355 })(); // Anonymous namespace | 360 })(); // Anonymous namespace |
OLD | NEW |