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

Side by Side Diff: chrome/test/functional/test_utils.py

Issue 5921001: Make sure private data does not inadverently get printed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | « no previous file | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import copy 7 import copy
8 import email 8 import email
9 import os 9 import os
10 import smtplib 10 import smtplib
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 username: user log in input. 80 username: user log in input.
81 password: user log in password input. 81 password: user log in password input.
82 tab_index: The tab index, default is 0. 82 tab_index: The tab index, default is 0.
83 windex: The window index, default is 0. 83 windex: The window index, default is 0.
84 """ 84 """
85 email_value = test.GetDOMValue('document.getElementById("Email").value', 85 email_value = test.GetDOMValue('document.getElementById("Email").value',
86 windex, tab_index) 86 windex, tab_index)
87 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value', 87 passwd_value = test.GetDOMValue('document.getElementById("Passwd").value',
88 windex, tab_index) 88 windex, tab_index)
89 test.assertEqual(email_value, username) 89 test.assertEqual(email_value, username)
90 test.assertEqual(passwd_value, password) 90 # Not using assertEqual because if it fails it would end up dumping the
91 # password (which is supposed to be private)
92 test.assertTrue(passwd_value == password)
91 93
92 94
93 def ClearPasswords(test): 95 def ClearPasswords(test):
94 """Clear saved passwords.""" 96 """Clear saved passwords."""
95 test.ClearBrowsingData(['PASSWORDS'], 'EVERYTHING') 97 test.ClearBrowsingData(['PASSWORDS'], 'EVERYTHING')
96 98
97 99
98 def Shell2(cmd_string, bg=False): 100 def Shell2(cmd_string, bg=False):
99 """Run a shell command. 101 """Run a shell command.
100 102
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return_dict[key] = StripUnmatchedKeys(dict1[key], dict2[key]) 192 return_dict[key] = StripUnmatchedKeys(dict1[key], dict2[key])
191 return return_dict 193 return return_dict
192 194
193 item_to_strip_type = type(item_to_strip) 195 item_to_strip_type = type(item_to_strip)
194 if item_to_strip_type is type(reference_item): 196 if item_to_strip_type is type(reference_item):
195 if item_to_strip_type is types.ListType: 197 if item_to_strip_type is types.ListType:
196 return StripList(item_to_strip, reference_item) 198 return StripList(item_to_strip, reference_item)
197 elif item_to_strip_type is types.DictType: 199 elif item_to_strip_type is types.DictType:
198 return StripDict(item_to_strip, reference_item) 200 return StripDict(item_to_strip, reference_item)
199 return copy.deepcopy(item_to_strip) 201 return copy.deepcopy(item_to_strip)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698