Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

722 lines
20 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. browdlg.ut
  7. Browsing subsystem unit tests
  8. These unit tests assume knowledge about the code. The goal here
  9. is to exercise all paths of the code.
  10. From a coding perspective, there are three different dialogs in
  11. the browsing subsystem: Browse dialog, Connect dialog, and
  12. Connection dialog. The first only appears in Windows 3.0, where
  13. it can be used to browse printers (from Control Panel Printers)
  14. as well as disks (from File Manager Connect Net Drive). The
  15. Connect dialog is invoked only by the Windows 3.1 File Manager,
  16. thus supporting only file connections. Lastly, the Connection
  17. dialog is invoked from the Windows 3.1 Control Panel, from where
  18. it handles printer connections. For more info, see header in
  19. shell\file\browsdlg.cxx and the Browsing Subsystem CDD.
  20. FILE HISTORY:
  21. rustanl 26-Mar-1991 Created
  22. rustanl 27-Mar-1991 Added tests for Connect, Connection,
  23. and Disconnect Drive dialogs
  24. */
  25. Disk Connect dialog
  26. ===================
  27. Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
  28. other domain.
  29. Bring up dialog from File Manager, Disk, Connect Net Drive, Browse
  30. Expect:
  31. Caption should be "Network Disk Resources"
  32. Net Path has focus, no text
  33. Text above outline listbox sez "Show File Resources on:"
  34. Outline listbox contains two domains, DOMAIN and NBU
  35. NBU domain expanded
  36. Text above Resource listbox (Resource Text) says "File
  37. Resources in NBU:", and is disabled
  38. Resource listbox has no item, and is disabled
  39. Click on "HARLEY" (may require scrolling)
  40. Expect:
  41. Net Path = "\\HARLEY\"
  42. Focus on outline listbox, where HARLEY is selected
  43. Resource Text = "File Resources on \\HARLEY:"
  44. Resource lb contains the *file* share on \\HARLEY
  45. No selection in Resource lb
  46. Click on "LM20" is outline listbox
  47. Expect:
  48. Net Path = "\\HARLEY\LM20"
  49. Focus on Resource listbox, where LM20 is selected
  50. Click OK:
  51. Expect:
  52. Network Path field in File Man's "Connect Network Drive"
  53. dialog should be "\\HARLEY\LM20"
  54. Click Browse again to re-enter Connect dialog
  55. Click "DEFICIT"
  56. Expect:
  57. Focus on Show listbox
  58. Click OK
  59. Expect:
  60. Focus on Network Path, with all text selected
  61. Click somewhere in Net Path to get eye beam cursor
  62. Click OK
  63. Expect:
  64. Focus on Network Path, with all text selected
  65. Type "\\deficit" (note, lower case)
  66. Click OK
  67. Expect:
  68. Net Path = "\\DEFICIT\"
  69. Focus on Network Path, with all text selected
  70. Click on one of the shares in lower listbox
  71. Type "\\deficit\" in Net Path field
  72. Press Enter
  73. Expect:
  74. Net Path = "\\DEFICIT\"
  75. Focus on Net Path, with all text selected
  76. No selection in Resource listbox
  77. Single click on "DEFICIT"
  78. Expect:
  79. Focus on Show listbox
  80. Resource listbox should not be refreshed
  81. Double click on "DEFICIT"
  82. Expect:
  83. Resource listbox should not be refreshed
  84. Click Help
  85. Expect:
  86. Help through WinHelp
  87. Get back to the browser without closing WinHelp.
  88. Click Cancel
  89. Expect:
  90. Network Path should still be "\\HARLEY\LM20"
  91. in File Man's dialog
  92. Aliases in Browse dialog (here, tested through the File Browse dialog)
  93. ========================
  94. Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
  95. other domain.
  96. Invoke the Browser from File Man
  97. Type "\\fishcake" in the Net Path field
  98. Press Enter
  99. Expect:
  100. Net Path = "\\FISHCAKE\"
  101. Show lb contains an expanded WINTEST domain
  102. Show lb contains FISHCAKE as a server under the WINTEST domain
  103. "FISHCAKE" is selected
  104. Resource Text reads "File Resources on \\FISHCAKE:"
  105. Resource lb contains the file shares on \\FISHCAKE
  106. Resource lb has focus, but has no selection
  107. Click "WINTEST" in Show lb
  108. Expect:
  109. Show lb has focus
  110. "WINTEST" is selected
  111. Resource Text = "File Resources in WINTEST:"
  112. Resource Text disabled
  113. Resource lb is empty and disabled
  114. Double click "WINTEST" (to collapse it)
  115. Double click "WINTEST" (to attempt to expand it)
  116. Expect:
  117. MsgPopup reading "The computer isn't active on this domain."
  118. Click Cancel.
  119. Log off from Control Panel.
  120. Log on from Control Panel, using normal username and password, but
  121. logon domain "WINTEST"
  122. Return to the Browser by clicking File Man's Browse button
  123. Expect:
  124. Domains displayed in the Show lb: DOMAIN, NBU, WINTEST
  125. "WINTEST" is selected
  126. Resource lb contains *file* aliases in WINTEST.
  127. Double click on "WINTEST"
  128. Expect:
  129. WINTEST domain expanded showing FISHCAKE as a server below
  130. Select alias "BPALIAS" in Resource lb
  131. Click OK
  132. Expect:
  133. Network Path in File Man's Connect Network Drive dialog
  134. reads "BPALIAS"
  135. Printer Browse dialog
  136. =====================
  137. Log on to NBU, with NBU as your wksta domain, and DOMAIN as an
  138. other domain.
  139. Enter Browser from Control Panel Printers
  140. Look for "PRT12088-1" in Show listbox; if found, repeat from
  141. beginning
  142. Type "\\prt12088-1\" in Netpath SLE
  143. Press Enter
  144. Expect:
  145. Caption of dialog = "Network Printer Resources"
  146. Network Path = "\\PRT12088-1\"
  147. Show Text says "Show Printers on:"
  148. Show lb selection on "PRT12088-1"
  149. Resources listbox shows *printer* shares on \\prt12088-1
  150. Focus is on Resource listbox, but no item is selected
  151. Double click "NBU"
  152. Expect:
  153. Net Path = ""
  154. Show lb has focus
  155. Domain NBU is collapsed. NBU item is selected.
  156. Resources Text disabled, with text "Printers in NBU:"
  157. Resources lb has no items, and is disabled.
  158. Double click "DOMAIN"
  159. Expect:
  160. Net Path = ""
  161. Show lb has focus
  162. Domain DOMAIN is expanded. DOMAIN item is selected.
  163. Resources Text disabled, with text "Printers in DOMAIN:"
  164. Resources lb has no items, and is disabled.
  165. Select a server in the DOMAIN domain
  166. Expect (you may have to repeat this several times, but there are normally
  167. several servers in the DOMAIN domain which generate this error):
  168. MsgPopup saying "The server is not configured for transactions."
  169. Click ON on MsgPopup
  170. Click on "DOMAIN" in Show lb
  171. Type "\\prt12088-5\" in Net Path SLE
  172. Press Enter.
  173. Expect:
  174. MsgPopup saying "The network path cannot be located"
  175. Click MsgPopup OK button
  176. Expect:
  177. Net Path = "\\prt12088-1"
  178. Focus on Net Path, with all text selected
  179. Type "\\hello*hello" in Net Path SLE
  180. Click OK.
  181. Expect:
  182. MsgPopup saying "Invalid parameter"
  183. Click OK in MsgPopup
  184. Type "\\h h" in Net Path SLE
  185. Press Enter
  186. Expect:
  187. MsgPopup saying "The network path cannot be located"
  188. Press Enter to dismiss MsgPopup
  189. Type "\\ABCDEFGHIJKLMNOPQRSTUVWXYZ01" in Net Path field
  190. Continue typing other letters
  191. Expect:
  192. When typing other letters, hear beep, and no change in
  193. Net Path field
  194. Press Enter
  195. Expect:
  196. MsgPopup saying "Invalid parameter"
  197. Dismiss MsgPopup by pressing Enter
  198. Type "\\PRT12088-1" in Net Path field
  199. Press Enter
  200. Expect:
  201. Net Path = "\\PRT12088-1\"
  202. Both DOMAIN and NBU domains expanded in Show lb
  203. "PRT12088-1" selected in Show lb
  204. Resource Text = "Printers on \\PRT12088-1:"
  205. Resource lb contains printer shares on \\PRT12088-1
  206. Resource lb has focus, but no item is selected
  207. Press F1
  208. Expect:
  209. WinHelp comes up
  210. Text in WinHelp reads "To connect to a printer:"
  211. Dismiss WinHelp by double clicking its systems menu
  212. Expect:
  213. Browse dialog is active
  214. Resource lb has focus
  215. Press Alt-H
  216. Dismiss WinHelp by pressing Alt-F4.
  217. Expect:
  218. Browse dialog is active
  219. Resource lb has focus
  220. Click on Help button
  221. Dismiss WinHelp by pressing Alt-F4
  222. Expect:
  223. Browse dialog is active
  224. Help button has focus, and is the default button
  225. Select all text in Net Path field
  226. Press Del
  227. Expect:
  228. Net Path = ""
  229. Net Path has focus
  230. OK button is default button
  231. Press Enter
  232. Expect:
  233. MsgPopup saying "The network path you specified in invalid"
  234. Press Enter to dismiss MsgPopup
  235. Type "hello" in Net Path field
  236. Select "NBU" in Show lb
  237. Press Enter
  238. Expect:
  239. Net Path = ""
  240. Show lb has focus
  241. "NBU" collapsed, and is selected
  242. Resource Text sez "Printers in NBU:" and is disabled
  243. Resource lb is disabled
  244. Press Enter
  245. Expect:
  246. Net Path = ""
  247. Show lb has focus
  248. "NBU" expanded, and is selected
  249. Type "MyAlias" in Net Path field
  250. Press Enter
  251. Expect:
  252. Path field in Printers - Network Connections dialog = "MyAlias"
  253. Click Browse button
  254. Type "\\hello*hello" in Net Path
  255. Press ESC
  256. Expect:
  257. Back in Printers - Network Connections dialog
  258. Path field = "MyAlias"
  259. Connect dialog
  260. ==============
  261. Log on to NBU, with NBU as your wksta domain, and DOMAIN as an other
  262. domain
  263. Fake lmuser.ini, if needed, so that Z: (and only Z:) is an unavailable
  264. drive, saved in the profile to be redirected to "\\DEFICIT\ZIMPORT"
  265. Bring up dialog from File Manager, Disk, Connect Net Drive
  266. Expect:
  267. Text before device combo = "Drive Letter:"
  268. Device combo contains drives to which one can connect
  269. (For this discussion, assume E: is the first such drive.)
  270. Focus on Net Path SLE
  271. Caption of dialog = "Connect Network Drive"
  272. NBU domain expanded
  273. Press Help button
  274. Expect:
  275. WinHelp with the topic "To connect a network drive"
  276. Close WinHelp
  277. Select "DEFICIT" in Show lb
  278. Select "PUBLIC" in Resources lb
  279. Expect:
  280. Net Path = "\\DEFICIT\PUBLIC"
  281. Press Enter
  282. Expect:
  283. E: appears as a drive in File Man's drive bar
  284. Single-click on E:
  285. Expect:
  286. "E: \\DEFICIT\PUBLIC" appears in drive bar
  287. Single-click on C:
  288. Bring up Connect dialog again
  289. Type "\\deficit"
  290. Press Enter
  291. Press Space (this will select the first item in the Resource lb;
  292. assume this item is ADF)
  293. Press Enter
  294. Expect:
  295. F: appears in File Man's drive bar
  296. Bring up Connect dialog again
  297. Type "\\DEFICIT\AD***" in Net Path field
  298. Press Enter
  299. Expect:
  300. MsgPopup saying "The network path you specified is invalid."
  301. Click OK to dismiss the MsgPopup
  302. Select Z: in the device combo
  303. Type "\\DEFICIT\ADF" in Net Path field
  304. Press Enter
  305. Expect:
  306. MsgPopup saying "You have a save connection on Z: to
  307. \\DEFICIT\ZIMPORT. Do you want to replace it with a save
  308. connection to \\DEFICIT\ADF?
  309. Click Cancel
  310. Expect:
  311. Net Path = "\\DEFICIT\ADF"
  312. Focus on Network Path field, with all text selected
  313. Press Enter
  314. Expect:
  315. Same MsgPopup as above (asking to overwrite entry in profile)
  316. Press F1
  317. Expect:
  318. WinHelp with appropriate topic
  319. Close WinHelp
  320. Press Yes to overwrite profile
  321. Expect:
  322. Z: still appears in File Man's drive bar, but is no longer
  323. grayed out
  324. Connection dialog
  325. =================
  326. Log on to NBU, with NBU as your wksta domain, and DOMAIN as an other
  327. domain
  328. Fake LPT1 and LPT2 in lmuser.ini, so that these appear to be
  329. unavailable, saved to be redirected to \\PRT12088-1\NOHOLES
  330. and \\PRT12088-1\PSCRIPT, respectively
  331. Bring up Connection dialog from Control Panel, Printers, Network.
  332. Expect:
  333. Caption = "Printers - Network Connections"
  334. Text above current connection listbox = "Network Printer
  335. Connections:"
  336. Currconn lb contains LPT1 \\PRT12088-1\NOHOLES and
  337. LPT2 \\PRT12088-1\PSCRIPT, both in the unavailable state
  338. Text before device combo = "Device Name:"
  339. Device combo contains devices to which one can connect
  340. Net Path = ""
  341. Focus on Net Path
  342. NBU domain expanded and selected
  343. OK is default button
  344. Disconnect and Reconnect buttons are disabled
  345. Type "x" in Net Path
  346. Expect:
  347. Connect button becomes default button
  348. Focus is still on Net Path
  349. Press Backspace
  350. Expect:
  351. OK button reverts to being the default button
  352. Focus is still on Net Path
  353. Type "\\prt12088-1" in Net Path
  354. Press Enter (which should trigger Connect button)
  355. Expect:
  356. Net Path = "\\PRT12088-1\"
  357. "PRT12088-1" selected in Show lb
  358. Resource lb contains printer shares on \\prt12088-1
  359. Resource lb has focus, but no selection
  360. Select "NITEAPL" in Resource lb
  361. Expect:
  362. Net Path = "\\PRT12088-1\NITEAPL"
  363. Connect is default button
  364. Select LPT1 in currconn lb
  365. Expect:
  366. LPT1 is selected in currconn lb
  367. Currconn lb has focus
  368. OK is default button
  369. Reconnect and Disconnect are enabled
  370. Connect button is disabled
  371. Net Path = ""
  372. Show lb has no selection
  373. Resource Text = "Printers on \\PRT12088-1:", but is grayed out
  374. Resource lb is disabled
  375. Select PRT12088-1 in Resource lb
  376. Expect:
  377. Currconn lb has no selection
  378. Disconnect and Reconnect are disabled.
  379. Connect is enabled, and is the default button
  380. Net Path = "\\PRT12088-1\"
  381. Focus in on Show lb
  382. PRT12088-1 is selected in the Show lb
  383. Click Help
  384. Expect:
  385. WinHelp with topic on how to connect a network printer
  386. Close WinHelp by double-clicking its system menu
  387. Click LPT2 in currconn lb
  388. Click in Net Path SLE to set focus there
  389. Type "\"
  390. Expect:
  391. No selection in currconn lb
  392. Reconnect and Disconnect buttons are disabled
  393. Connect is enabled and is default button
  394. Focus on Net Path
  395. No selection in Show lb
  396. Resource Text = "Printers on \\PRT12088-1:", but is grayed
  397. Resource lb disabled
  398. Click on LPT2 in currconn listbox
  399. Click on device combo to set focus there
  400. Press Down (arrow key on keyboard)
  401. Expect:
  402. No selection in currconn lb
  403. Device combo = "LPT2"
  404. Device combo has focus
  405. OK is default button
  406. Connect button is enabled
  407. Net Path = ""
  408. Click on LPT2 in currconn lb
  409. Click on device combo button which brings down the drop-down list
  410. Expect:
  411. No selection in currconn lb
  412. Device combo is dropped down
  413. OK is default button
  414. Connect is enabled
  415. Select "LPT1" in device combo
  416. Select "PRT12088-1" in Show lb
  417. Select "NITEHOLE" in Resource lb
  418. Click Connect button
  419. Expect:
  420. MsgPopup warning msg: "You have a saved connection on LPT1
  421. to \\PRT12088-1\NOHOLES. Do you want to replace it with
  422. a saved connection to \\PRT12088-1\NITEHOLE?"
  423. Click No
  424. Expect:
  425. Currconn lb contains LPT1 \\PRT12088-1\NITEHOLE which is
  426. available, and LPT2 \\PRT12088-1\PSCRIPT which is
  427. disabled.
  428. Device combo should no longer contain LPT1, and LPT2 should
  429. be selected.
  430. Click on LPT1 in currconn lb
  431. Expect:
  432. Disconnect button is enabled
  433. Reconnect button is disabled
  434. Click on LPT2 in currconn lb
  435. Click Reconnect button
  436. Expect:
  437. The icon for LPT2 in currconn lb now indicates "available"
  438. OK button is default button
  439. Currconn lb has focus
  440. LPT2 is selected in currconn lb
  441. Disconnect button is enabled
  442. Reconnect button is disabled
  443. Device combo does not contain LPT2
  444. "LPT3" is selected in device combo
  445. Click on LPT1 in currconn lb
  446. Click Disconnect button
  447. Expect:
  448. Currconn lb contains LPT1 \\PRT12088\NOHOLES (unavailable),
  449. and LPT2 \\PRT12088\PSCRIPT (available)
  450. OK button has focus
  451. OK button is default button
  452. Disconnect and Reconnect buttons are disabled
  453. Device combo should now contain LPT1, and LPT1 should be selected
  454. Select LPT1 in currconn lb
  455. Click on Disconnect
  456. Expect:
  457. MsgPopup saying "Do you want to stop connection [...]"
  458. Click Yes
  459. Expect:
  460. Currconn listbox contains LPT2 \\PRT12088-1\PSCRIPT (available)
  461. OK button has focus
  462. OK button is default button
  463. Disconnect and Reconnect buttons are disabled
  464. Click on LPT2 in currconn lb
  465. Click on Disconnect
  466. Expect:
  467. Network Printer Connection text is grayed
  468. Currconn lb is disabled
  469. OK button has focus
  470. OK button is default button
  471. Disconnect and Reconnect buttons are disabled
  472. Press Enter
  473. Expect:
  474. Back in Control Panel Printers listbox
  475. Click Network button
  476. Expect:
  477. Network Printer Connection text disabled
  478. Currconn lb disabled
  479. OK button is default button
  480. Disconnect and Reconnect buttons are disabled
  481. Focus on Net Path
  482. Connect button is enabled
  483. Show lb selection is on "NBU"
  484. Type "\\prt12088-1" in Net Path SLE
  485. Press Enter
  486. Select "HOLES" in Resource lb
  487. Press Enter
  488. Expect:
  489. Network Printer Connection text enabled
  490. Currconn lb contains LPT1 \\PRT12088-1\HOLES
  491. Currconn lb is enabled
  492. Device combo does not contain LPT1
  493. "LPT2" is selected in device combo
  494. Disconnect and Reconnect buttons are disabled
  495. Connect button is enabled and has focus
  496. Select all text in Net Path SLE
  497. Press Del
  498. Press Enter
  499. Expect:
  500. Back in Control Panel Printers dialog
  501. Disconnect Drive dialog
  502. =======================
  503. Log on to NBU domain, with NBU as wksta domain, and DOMAIN as
  504. other domain
  505. Make sure to have at least the following connections:
  506. H: \\HARLEY\SCRATCH (available)
  507. V: \\VOGON\SCRATCH (unavailable)
  508. Bring up Disconnect Drive dialog from Win 3.1 File Man, Drive,
  509. Disconnect Net Drive
  510. Expect:
  511. Currconn lb contains H: \\HARLEY\SCRATCH (available),
  512. V: \\VOGON\SCRATCH (unavailable)
  513. "H:" is selected in currconn lb
  514. Focus in on currconn lb
  515. OK is default button
  516. Press Enter
  517. Expect:
  518. File Man drive bar no longer contains H:
  519. Bring up the Disconnect Drive dialog again
  520. Click Cancel
  521. Expect:
  522. No change in File Man drive bar
  523. Bring up the Disconnect Drive dialog again
  524. Press Alt-H
  525. Expect:
  526. WinHelp on topic "To disconnect from network drive"
  527. Get back to the Disconnect Drive dialog without dismissing WinHelp
  528. Select "V:" in currconn lb
  529. Click OK
  530. Expect:
  531. MsgPopup warning saying: "Do you want to stop connecting
  532. V: to \\VOGON\SCRATCH when you log on to the network?"
  533. MsgPopup should have Yes/No/Help buttons
  534. Yes is default button
  535. Type Alt-N
  536. Expect:
  537. Disconnect Drive dialog is dismissed
  538. WinHelp is dismissed
  539. Y: still appears unavailable in File Man drive bar
  540. Bring up the Disconnect Drive dialog once more
  541. Select Y: in currconn lb
  542. Press OK in dialog
  543. Press Yes in MsgPopup
  544. Expect:
  545. Y: no longer exists in File Man drive bar
  546. Auto Logon
  547. ==========
  548. (Repeat the following test for the each of the Browse (one resource
  549. type will suffice), Connect, and Connection dialogs.)
  550. Log off
  551. Attempt to invoke the dialog
  552. Expect:
  553. MsgPopup with msg: "You are currently not logged on. [...]
  554. Do you wish to log on?"
  555. Choose No
  556. Expect:
  557. Message box saying you must log on in order to connect
  558. Attempt to invoke the dialog again
  559. Choose Yes in MsgPopup
  560. Expect:
  561. Logon dialog
  562. Choose Cancel from Logon dialog
  563. Expect:
  564. Message box saying you must log on in order to connect
  565. Attempt to invoke the dialog again
  566. Choose Yes in MsgPopup
  567. Type an password different from the one used to log on to NBU
  568. Click OK
  569. Expect:
  570. MsgPopup about: "The password entered in invalid. You
  571. must eneter a valid password to log on."
  572. Click OK
  573. Type in your real password
  574. Press Enter
  575. Expect:
  576. MsgPopup saying "Your were successfully logged on to NBU as
  577. <USER> by <SERVER> with USER privilege."
  578. Click OK
  579. Expect:
  580. The dialog that you tried to bring up.
  581. Profile should have been loaded (check this somehow)
  582. Dismiss the dialog
  583. Expect:
  584. For Connect dialog, File Man should refresh