MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / CreateUniqueTempDir

Method CreateUniqueTempDir

cpp/iedriver/BrowserFactory.cpp:352–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352bool BrowserFactory::CreateUniqueTempDir(std::wstring &temp_dir) {
353 // get temporary folder for the current user
354 wchar_t temp_path_array[128];
355 ::GetTempPath(128, temp_path_array);
356 std::wstring temp_path = temp_path_array;
357 if (!DirectoryExists(temp_path)) {
358 return false;
359 }
360
361 // create a IEDriver temporary folder inside the user level temporary folder
362 bool temp_dir_created = false;
363 for (int i = 0; i < 10; i++) {
364 std::wstring output =
365 temp_path + L"IEDriver-" + StringUtilities::CreateGuid();
366 if (DirectoryExists(output)) {
367 continue;
368 }
369
370 ::CreateDirectory(output.c_str(), NULL);
371 if (!DirectoryExists(output)) {
372 continue;
373 }
374
375 temp_dir = output;
376 temp_dir_created = true;
377 break;
378 }
379
380 return temp_dir_created;
381}
382
383void BrowserFactory::LaunchEdgeInIEMode(PROCESS_INFORMATION* proc_info,
384 std::string* error_message) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected