windows-nt/Source/XPSP1/NT/admin/netui/shell/test/browdlg.ut
2020-09-26 16:20:57 +08:00

723 lines
20 KiB
Plaintext

/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1991 **/
/**********************************************************************/
/*
browdlg.ut
Browsing subsystem unit tests
These unit tests assume knowledge about the code. The goal here
is to exercise all paths of the code.
From a coding perspective, there are three different dialogs in
the browsing subsystem: Browse dialog, Connect dialog, and
Connection dialog. The first only appears in Windows 3.0, where
it can be used to browse printers (from Control Panel Printers)
as well as disks (from File Manager Connect Net Drive). The
Connect dialog is invoked only by the Windows 3.1 File Manager,
thus supporting only file connections. Lastly, the Connection
dialog is invoked from the Windows 3.1 Control Panel, from where
it handles printer connections. For more info, see header in
shell\file\browsdlg.cxx and the Browsing Subsystem CDD.
FILE HISTORY:
rustanl 26-Mar-1991 Created
rustanl 27-Mar-1991 Added tests for Connect, Connection,
and Disconnect Drive dialogs
*/
Disk Connect dialog
===================
Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
other domain.
Bring up dialog from File Manager, Disk, Connect Net Drive, Browse
Expect:
Caption should be "Network Disk Resources"
Net Path has focus, no text
Text above outline listbox sez "Show File Resources on:"
Outline listbox contains two domains, DOMAIN and NBU
NBU domain expanded
Text above Resource listbox (Resource Text) says "File
Resources in NBU:", and is disabled
Resource listbox has no item, and is disabled
Click on "HARLEY" (may require scrolling)
Expect:
Net Path = "\\HARLEY\"
Focus on outline listbox, where HARLEY is selected
Resource Text = "File Resources on \\HARLEY:"
Resource lb contains the *file* share on \\HARLEY
No selection in Resource lb
Click on "LM20" is outline listbox
Expect:
Net Path = "\\HARLEY\LM20"
Focus on Resource listbox, where LM20 is selected
Click OK:
Expect:
Network Path field in File Man's "Connect Network Drive"
dialog should be "\\HARLEY\LM20"
Click Browse again to re-enter Connect dialog
Click "DEFICIT"
Expect:
Focus on Show listbox
Click OK
Expect:
Focus on Network Path, with all text selected
Click somewhere in Net Path to get eye beam cursor
Click OK
Expect:
Focus on Network Path, with all text selected
Type "\\deficit" (note, lower case)
Click OK
Expect:
Net Path = "\\DEFICIT\"
Focus on Network Path, with all text selected
Click on one of the shares in lower listbox
Type "\\deficit\" in Net Path field
Press Enter
Expect:
Net Path = "\\DEFICIT\"
Focus on Net Path, with all text selected
No selection in Resource listbox
Single click on "DEFICIT"
Expect:
Focus on Show listbox
Resource listbox should not be refreshed
Double click on "DEFICIT"
Expect:
Resource listbox should not be refreshed
Click Help
Expect:
Help through WinHelp
Get back to the browser without closing WinHelp.
Click Cancel
Expect:
Network Path should still be "\\HARLEY\LM20"
in File Man's dialog
Aliases in Browse dialog (here, tested through the File Browse dialog)
========================
Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
other domain.
Invoke the Browser from File Man
Type "\\fishcake" in the Net Path field
Press Enter
Expect:
Net Path = "\\FISHCAKE\"
Show lb contains an expanded WINTEST domain
Show lb contains FISHCAKE as a server under the WINTEST domain
"FISHCAKE" is selected
Resource Text reads "File Resources on \\FISHCAKE:"
Resource lb contains the file shares on \\FISHCAKE
Resource lb has focus, but has no selection
Click "WINTEST" in Show lb
Expect:
Show lb has focus
"WINTEST" is selected
Resource Text = "File Resources in WINTEST:"
Resource Text disabled
Resource lb is empty and disabled
Double click "WINTEST" (to collapse it)
Double click "WINTEST" (to attempt to expand it)
Expect:
MsgPopup reading "The computer isn't active on this domain."
Click Cancel.
Log off from Control Panel.
Log on from Control Panel, using normal username and password, but
logon domain "WINTEST"
Return to the Browser by clicking File Man's Browse button
Expect:
Domains displayed in the Show lb: DOMAIN, NBU, WINTEST
"WINTEST" is selected
Resource lb contains *file* aliases in WINTEST.
Double click on "WINTEST"
Expect:
WINTEST domain expanded showing FISHCAKE as a server below
Select alias "BPALIAS" in Resource lb
Click OK
Expect:
Network Path in File Man's Connect Network Drive dialog
reads "BPALIAS"
Printer Browse dialog
=====================
Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
other domain.
Enter Browser from Control Panel Printers
Look for "PRT12088-1" in Show listbox; if found, repeat from
beginning
Type "\\prt12088-1\" in Netpath SLE
Press Enter
Expect:
Caption of dialog = "Network Printer Resources"
Network Path = "\\PRT12088-1\"
Show Text says "Show Printers on:"
Show lb selection on "PRT12088-1"
Resources listbox shows *printer* shares on \\prt12088-1
Focus is on Resource listbox, but no item is selected
Double click "NBU"
Expect:
Net Path = ""
Show lb has focus
Domain NBU is collapsed. NBU item is selected.
Resources Text disabled, with text "Printers in NBU:"
Resources lb has no items, and is disabled.
Double click "DOMAIN"
Expect:
Net Path = ""
Show lb has focus
Domain DOMAIN is expanded. DOMAIN item is selected.
Resources Text disabled, with text "Printers in DOMAIN:"
Resources lb has no items, and is disabled.
Select a server in the DOMAIN domain
Expect (you may have to repeat this several times, but there are normally
several servers in the DOMAIN domain which generate this error):
MsgPopup saying "The server is not configured for transactions."
Click ON on MsgPopup
Click on "DOMAIN" in Show lb
Type "\\prt12088-5\" in Net Path SLE
Press Enter.
Expect:
MsgPopup saying "The network path cannot be located"
Click MsgPopup OK button
Expect:
Net Path = "\\prt12088-1"
Focus on Net Path, with all text selected
Type "\\hello*hello" in Net Path SLE
Click OK.
Expect:
MsgPopup saying "Invalid parameter"
Click OK in MsgPopup
Type "\\h h" in Net Path SLE
Press Enter
Expect:
MsgPopup saying "The network path cannot be located"
Press Enter to dismiss MsgPopup
Type "\\ABCDEFGHIJKLMNOPQRSTUVWXYZ01" in Net Path field
Continue typing other letters
Expect:
When typing other letters, hear beep, and no change in
Net Path field
Press Enter
Expect:
MsgPopup saying "Invalid parameter"
Dismiss MsgPopup by pressing Enter
Type "\\PRT12088-1" in Net Path field
Press Enter
Expect:
Net Path = "\\PRT12088-1\"
Both DOMAIN and NBU domains expanded in Show lb
"PRT12088-1" selected in Show lb
Resource Text = "Printers on \\PRT12088-1:"
Resource lb contains printer shares on \\PRT12088-1
Resource lb has focus, but no item is selected
Press F1
Expect:
WinHelp comes up
Text in WinHelp reads "To connect to a printer:"
Dismiss WinHelp by double clicking its systems menu
Expect:
Browse dialog is active
Resource lb has focus
Press Alt-H
Dismiss WinHelp by pressing Alt-F4.
Expect:
Browse dialog is active
Resource lb has focus
Click on Help button
Dismiss WinHelp by pressing Alt-F4
Expect:
Browse dialog is active
Help button has focus, and is the default button
Select all text in Net Path field
Press Del
Expect:
Net Path = ""
Net Path has focus
OK button is default button
Press Enter
Expect:
MsgPopup saying "The network path you specified in invalid"
Press Enter to dismiss MsgPopup
Type "hello" in Net Path field
Select "NBU" in Show lb
Press Enter
Expect:
Net Path = ""
Show lb has focus
"NBU" collapsed, and is selected
Resource Text sez "Printers in NBU:" and is disabled
Resource lb is disabled
Press Enter
Expect:
Net Path = ""
Show lb has focus
"NBU" expanded, and is selected
Type "MyAlias" in Net Path field
Press Enter
Expect:
Path field in Printers - Network Connections dialog = "MyAlias"
Click Browse button
Type "\\hello*hello" in Net Path
Press ESC
Expect:
Back in Printers - Network Connections dialog
Path field = "MyAlias"
Connect dialog
==============
Log on to NBU, with NBU as your wksta domain, and DOMAIN as an other
domain
Fake lmuser.ini, if needed, so that Z: (and only Z:) is an unavailable
drive, saved in the profile to be redirected to "\\DEFICIT\ZIMPORT"
Bring up dialog from File Manager, Disk, Connect Net Drive
Expect:
Text before device combo = "Drive Letter:"
Device combo contains drives to which one can connect
(For this discussion, assume E: is the first such drive.)
Focus on Net Path SLE
Caption of dialog = "Connect Network Drive"
NBU domain expanded
Press Help button
Expect:
WinHelp with the topic "To connect a network drive"
Close WinHelp
Select "DEFICIT" in Show lb
Select "PUBLIC" in Resources lb
Expect:
Net Path = "\\DEFICIT\PUBLIC"
Press Enter
Expect:
E: appears as a drive in File Man's drive bar
Single-click on E:
Expect:
"E: \\DEFICIT\PUBLIC" appears in drive bar
Single-click on C:
Bring up Connect dialog again
Type "\\deficit"
Press Enter
Press Space (this will select the first item in the Resource lb;
assume this item is ADF)
Press Enter
Expect:
F: appears in File Man's drive bar
Bring up Connect dialog again
Type "\\DEFICIT\AD***" in Net Path field
Press Enter
Expect:
MsgPopup saying "The network path you specified is invalid."
Click OK to dismiss the MsgPopup
Select Z: in the device combo
Type "\\DEFICIT\ADF" in Net Path field
Press Enter
Expect:
MsgPopup saying "You have a save connection on Z: to
\\DEFICIT\ZIMPORT. Do you want to replace it with a save
connection to \\DEFICIT\ADF?
Click Cancel
Expect:
Net Path = "\\DEFICIT\ADF"
Focus on Network Path field, with all text selected
Press Enter
Expect:
Same MsgPopup as above (asking to overwrite entry in profile)
Press F1
Expect:
WinHelp with appropriate topic
Close WinHelp
Press Yes to overwrite profile
Expect:
Z: still appears in File Man's drive bar, but is no longer
grayed out
Connection dialog
=================
Log on to NBU, with NBU as your wksta domain, and DOMAIN as an other
domain
Fake LPT1 and LPT2 in lmuser.ini, so that these appear to be
unavailable, saved to be redirected to \\PRT12088-1\NOHOLES
and \\PRT12088-1\PSCRIPT, respectively
Bring up Connection dialog from Control Panel, Printers, Network.
Expect:
Caption = "Printers - Network Connections"
Text above current connection listbox = "Network Printer
Connections:"
Currconn lb contains LPT1 \\PRT12088-1\NOHOLES and
LPT2 \\PRT12088-1\PSCRIPT, both in the unavailable state
Text before device combo = "Device Name:"
Device combo contains devices to which one can connect
Net Path = ""
Focus on Net Path
NBU domain expanded and selected
OK is default button
Disconnect and Reconnect buttons are disabled
Type "x" in Net Path
Expect:
Connect button becomes default button
Focus is still on Net Path
Press Backspace
Expect:
OK button reverts to being the default button
Focus is still on Net Path
Type "\\prt12088-1" in Net Path
Press Enter (which should trigger Connect button)
Expect:
Net Path = "\\PRT12088-1\"
"PRT12088-1" selected in Show lb
Resource lb contains printer shares on \\prt12088-1
Resource lb has focus, but no selection
Select "NITEAPL" in Resource lb
Expect:
Net Path = "\\PRT12088-1\NITEAPL"
Connect is default button
Select LPT1 in currconn lb
Expect:
LPT1 is selected in currconn lb
Currconn lb has focus
OK is default button
Reconnect and Disconnect are enabled
Connect button is disabled
Net Path = ""
Show lb has no selection
Resource Text = "Printers on \\PRT12088-1:", but is grayed out
Resource lb is disabled
Select PRT12088-1 in Resource lb
Expect:
Currconn lb has no selection
Disconnect and Reconnect are disabled.
Connect is enabled, and is the default button
Net Path = "\\PRT12088-1\"
Focus in on Show lb
PRT12088-1 is selected in the Show lb
Click Help
Expect:
WinHelp with topic on how to connect a network printer
Close WinHelp by double-clicking its system menu
Click LPT2 in currconn lb
Click in Net Path SLE to set focus there
Type "\"
Expect:
No selection in currconn lb
Reconnect and Disconnect buttons are disabled
Connect is enabled and is default button
Focus on Net Path
No selection in Show lb
Resource Text = "Printers on \\PRT12088-1:", but is grayed
Resource lb disabled
Click on LPT2 in currconn listbox
Click on device combo to set focus there
Press Down (arrow key on keyboard)
Expect:
No selection in currconn lb
Device combo = "LPT2"
Device combo has focus
OK is default button
Connect button is enabled
Net Path = ""
Click on LPT2 in currconn lb
Click on device combo button which brings down the drop-down list
Expect:
No selection in currconn lb
Device combo is dropped down
OK is default button
Connect is enabled
Select "LPT1" in device combo
Select "PRT12088-1" in Show lb
Select "NITEHOLE" in Resource lb
Click Connect button
Expect:
MsgPopup warning msg: "You have a saved connection on LPT1
to \\PRT12088-1\NOHOLES. Do you want to replace it with
a saved connection to \\PRT12088-1\NITEHOLE?"
Click No
Expect:
Currconn lb contains LPT1 \\PRT12088-1\NITEHOLE which is
available, and LPT2 \\PRT12088-1\PSCRIPT which is
disabled.
Device combo should no longer contain LPT1, and LPT2 should
be selected.
Click on LPT1 in currconn lb
Expect:
Disconnect button is enabled
Reconnect button is disabled
Click on LPT2 in currconn lb
Click Reconnect button
Expect:
The icon for LPT2 in currconn lb now indicates "available"
OK button is default button
Currconn lb has focus
LPT2 is selected in currconn lb
Disconnect button is enabled
Reconnect button is disabled
Device combo does not contain LPT2
"LPT3" is selected in device combo
Click on LPT1 in currconn lb
Click Disconnect button
Expect:
Currconn lb contains LPT1 \\PRT12088\NOHOLES (unavailable),
and LPT2 \\PRT12088\PSCRIPT (available)
OK button has focus
OK button is default button
Disconnect and Reconnect buttons are disabled
Device combo should now contain LPT1, and LPT1 should be selected
Select LPT1 in currconn lb
Click on Disconnect
Expect:
MsgPopup saying "Do you want to stop connection [...]"
Click Yes
Expect:
Currconn listbox contains LPT2 \\PRT12088-1\PSCRIPT (available)
OK button has focus
OK button is default button
Disconnect and Reconnect buttons are disabled
Click on LPT2 in currconn lb
Click on Disconnect
Expect:
Network Printer Connection text is grayed
Currconn lb is disabled
OK button has focus
OK button is default button
Disconnect and Reconnect buttons are disabled
Press Enter
Expect:
Back in Control Panel Printers listbox
Click Network button
Expect:
Network Printer Connection text disabled
Currconn lb disabled
OK button is default button
Disconnect and Reconnect buttons are disabled
Focus on Net Path
Connect button is enabled
Show lb selection is on "NBU"
Type "\\prt12088-1" in Net Path SLE
Press Enter
Select "HOLES" in Resource lb
Press Enter
Expect:
Network Printer Connection text enabled
Currconn lb contains LPT1 \\PRT12088-1\HOLES
Currconn lb is enabled
Device combo does not contain LPT1
"LPT2" is selected in device combo
Disconnect and Reconnect buttons are disabled
Connect button is enabled and has focus
Select all text in Net Path SLE
Press Del
Press Enter
Expect:
Back in Control Panel Printers dialog
Disconnect Drive dialog
=======================
Log on to NBU domain, with NBU as wksta domain, and DOMAIN as
other domain
Make sure to have at least the following connections:
H: \\HARLEY\SCRATCH (available)
V: \\VOGON\SCRATCH (unavailable)
Bring up Disconnect Drive dialog from Win 3.1 File Man, Drive,
Disconnect Net Drive
Expect:
Currconn lb contains H: \\HARLEY\SCRATCH (available),
V: \\VOGON\SCRATCH (unavailable)
"H:" is selected in currconn lb
Focus in on currconn lb
OK is default button
Press Enter
Expect:
File Man drive bar no longer contains H:
Bring up the Disconnect Drive dialog again
Click Cancel
Expect:
No change in File Man drive bar
Bring up the Disconnect Drive dialog again
Press Alt-H
Expect:
WinHelp on topic "To disconnect from network drive"
Get back to the Disconnect Drive dialog without dismissing WinHelp
Select "V:" in currconn lb
Click OK
Expect:
MsgPopup warning saying: "Do you want to stop connecting
V: to \\VOGON\SCRATCH when you log on to the network?"
MsgPopup should have Yes/No/Help buttons
Yes is default button
Type Alt-N
Expect:
Disconnect Drive dialog is dismissed
WinHelp is dismissed
Y: still appears unavailable in File Man drive bar
Bring up the Disconnect Drive dialog once more
Select Y: in currconn lb
Press OK in dialog
Press Yes in MsgPopup
Expect:
Y: no longer exists in File Man drive bar
Auto Logon
==========
(Repeat the following test for the each of the Browse (one resource
type will suffice), Connect, and Connection dialogs.)
Log off
Attempt to invoke the dialog
Expect:
MsgPopup with msg: "You are currently not logged on. [...]
Do you wish to log on?"
Choose No
Expect:
Message box saying you must log on in order to connect
Attempt to invoke the dialog again
Choose Yes in MsgPopup
Expect:
Logon dialog
Choose Cancel from Logon dialog
Expect:
Message box saying you must log on in order to connect
Attempt to invoke the dialog again
Choose Yes in MsgPopup
Type an password different from the one used to log on to NBU
Click OK
Expect:
MsgPopup about: "The password entered in invalid. You
must eneter a valid password to log on."
Click OK
Type in your real password
Press Enter
Expect:
MsgPopup saying "Your were successfully logged on to NBU as
<USER> by <SERVER> with USER privilege."
Click OK
Expect:
The dialog that you tried to bring up.
Profile should have been loaded (check this somehow)
Dismiss the dialog
Expect:
For Connect dialog, File Man should refresh