Skip to content

Commit

Permalink
Merge pull request swiftlang#244 from apple/revert-243-revert-241-mak…
Browse files Browse the repository at this point in the history
…e-runloopmode-nested

[5.0] Revert "Revert "Convert RunLoopMode to RunLoop.Mode as with Darwin Foundation""
  • Loading branch information
ikesyo committed Jan 28, 2019
2 parents e117f36 + 6cdd5d1 commit 51afda0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ open class XCTNSPredicateExpectation: XCTestExpectation {
}
}

runLoop.add(timer, forMode: .defaultRunLoopMode)
runLoop.add(timer, forMode: .default)
queue.async {
self.timer = timer
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTest/Public/Asynchronous/XCTWaiter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private extension XCTWaiter {
let timeIntervalToRun = min(0.1, timeout)

// RunLoop.run(mode:before:) should have @discardableResult <rdar://problem/45371901>
_ = runLoop.run(mode: .defaultRunLoopMode, before: Date(timeIntervalSinceNow: timeIntervalToRun))
_ = runLoop.run(mode: .default, before: Date(timeIntervalSinceNow: timeIntervalToRun))
}

func cancelPrimitiveWait() {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Asynchronous/Expectations/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExpectationsTestCase: XCTestCase {
let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in
expectation.fulfill()
}
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
RunLoop.current.add(timer, forMode: .default)
waitForExpectations(timeout: 1.0)
}

Expand All @@ -59,7 +59,7 @@ class ExpectationsTestCase: XCTestCase {
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { _ in
expectation.fulfill()
}
RunLoop.current.add(timer, forMode: .defaultRunLoopMode)
RunLoop.current.add(timer, forMode: .default)
waitForExpectations(timeout: 0.1)
}

Expand Down

0 comments on commit 51afda0

Please sign in to comment.